So, I'd like to use the statement

DELETE FROM moz_cookies WHERE lastAccessed <= ?1 ORDER BY lastAccessed ASC
LIMIT ?2

for a query in Firefox backend code (we use the shipped amalgamation, which
doesn't allow SQLITE_ENABLE_UPDATE_DELETE_LIMIT). The closest query we can
implement, as far as I can tell, would be (note id is the pkey):

DELETE FROM moz_cookies WHERE id IN (SELECT id FROM moz_cookies WHERE
lastAccessed
<= ?1 ORDER BY lastAccessed ASC LIMIT ?2)

Will sqlite optimize the latter to the former? If not, what are the likely
perf differences here? (And why isn't SQLITE_ENABLE_UPDATE_DELETE_LIMIT
enabled by default?)

Many thanks in advance.

Regards,
Dan.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to