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.


Yes, the execution plans are the same. Still the second is faster!

Another query that uses EXCEPT instead of NOT IN and that has yet another execution plan:

select id from nodes except select child from edges;
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to