[sqlite] Query hung. Any help. (sqlite dbi)

2010-10-18 Thread Tilghman, Jack
Query hung. Any help. (sqlite dbi) SQLite version 3.7.2 built on This is perl, v5.8.8 built for x86_64-linux-thread-multi DBI 1.611 DBD::SQLite 1.29 Centos Linux(2.6.18-164.11.1.el5xen) 64bit. Below are output snippets from two dbi trace files. In the first snippet, the sqlite.db is smallish,

Re: [sqlite] Query hung. Any help. (sqlite dbi)

2010-10-18 Thread Igor Tandetnik
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

[sqlite] Query hung. Any help. (sqlite dbi)

2010-10-18 Thread Tilghman, Jack
Thanks Igor, works great! Btw, was there something incorrect about the way I had the query setup? Thanks, Jack The information contained in this communication may be CONFIDENTIAL and is intended only for the use of the recipient(s) named above. If you are not the intended recipient, you

Re: [sqlite] Query hung. Any help. (sqlite dbi)

2010-10-18 Thread Igor Tandetnik
Tilghman, Jack jack.tilgh...@navteq.com wrote: Thanks Igor, works great! Btw, was there something incorrect about the way I had the query setup? Not incorrect, just wasteful. I suspect the query was spending a lot of time working through rows where link and node do match up, only to throw

[sqlite] Query hung. Any help. (sqlite dbi)

2010-10-18 Thread Tilghman, Jack
Nice Explanation Igor. As it turns out, virtually all of the rows will match up as you correctly suspected. Thanks again. Jack The information contained in this communication may be CONFIDENTIAL and is intended only for the use of the recipient(s) named above. If you are not the

Re: [sqlite] Query hung. Any help. (sqlite dbi)

2010-10-18 Thread Petite Abeille
On Oct 18, 2010, at 6:58 PM, Igor Tandetnik wrote: In general, I found that the idiom TableA left join TableB on (TableA.idInTableB = TableB.someId) where TableB.someId is null almost always performs worse than the equivalent NOT EXISTS or NOT IN query. Hmmm... in practice it should be