Tilghman, Jack <jack.tilgh...@navteq.com> wrote:
> sqlite trace: prepare statement: SELECT COUNT(*) FROM link LEFT OUTER JOIN 
> node ON node.pvid = link.ref_node_pvid WHERE
>    link.ref_node_pvid != -1 AND link.ref_node_pvid != -2 AND node.pvid IS 
> NULL;

Try this instead:

SELECT COUNT(*) FROM link
where ref_node_pvid not in (-1, -2) and ref_node_pvid not in (select pvid from 
node);

Make sure you have an index (or a primary key or unique constraint) on 
node(pvid).
-- 
Igor Tandetnik


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

Reply via email to