Hi,
INNER JOIN "entrys" ON 1 = "entrys"."log-id" AND "specific-entrys"."key" = "entrys"."key" AND "user" = "entrys"."region" AND "specific-entrys"."entry-number" = "entrys"."entry-number" AND "entrys"."key" > "G"I can't solve your problem, but the PRIMARY KEY for "entrys" is ("log-id", "entry-number"). You shouldn't need to match so many different fields when just two of them, which you already have values for, narrow your search down to a single row. Though I may be missing something.
In past attempts at improving query performance these have been added to encourage it to use an index that it can do a SCAN thru' rather than the table that it would need to do a SEARCH thru'.
I'm pretty happy with the indexes it's currently choosing (apart from the MATERIALIZE). Adding a covering index on timestamp theoretically improves things but doesn't seem to make a (measurable) difference in practice with current data sizes.
Best wishes, @ndy -- [email protected] http://www.ashurst.eu.org/ 0x7EBA75FF _______________________________________________ sqlite-users mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

