Luuk wrote: >> Clemens Ladisch wrote: >>> Luuk wrote: >>>> On 01-01-18 03:14, Shane Dev wrote: >>>>> select * from nodes where not exists (select * from edges where >>>>> child=nodes.id); >>>> >>>> Changing this to: >>>> >>>> select * from nodes where not exists (select 1 from edges where >>>> child=nodes.id); >>>> >>>> saved in my test about 10% of time >>> >>> Then I have to doubt your test; the generated code (see the EXPLAIN >>> output) is exactly the same. > > the 3rd step of EXPLAIN changed from: > > 1|0|0|SCAN TABLE edges > to: > 1|0|0|SCAN TABLE edges USING COVERING INDEX iedges
Indeed it does; my own test was without the index. Regards, Clemens _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users