Thanks again Clemens.

> -----Original Message-----
> From: [email protected] [mailto:sqlite-users-
> [email protected]] On Behalf Of Clemens Ladisch
> Sent: 09 November 2012 15:08
> To: [email protected]
> Subject: Re: [sqlite] Anomalously slow performance on updates to
> earlyentries in a DB
> 
> O'Toole, Eamonn wrote:
> >                     DELETE FROM object
> >                     WHERE name = ? AND (created_at < ?)
> 
> This needs an index with "name" as the *first* column.
> 
> >                     query += ' AND deleted IN (0, 1)'
> 
> If the name column is (nearly) unique, putting indexes on the
> created_at
> or deleted columns is not useful (for this query).

[O'Toole, Eamonn] The name column is guaranteed to be unique.
> 
> See <http://www.sqlite.org/queryplanner.html> for an explanation of how
> indexes work.
> 
> 
> Regards,
> Clemens
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to