[CLUG-tech] SQL Query Question

Chris Meistre meistrch at intekom.co.za
Tue Dec 18 22:49:14 SAST 2007


Hi there,

I have a table with more than 900,000 entries in.

table1
url
text

I also have another table that I put values about table1's info.

table2
url
moretext

For various reasons I cannot put the data together in one table, and 
need to use 2 tables.   Once I do something to the values I put them in 
table2.  And then I don't touch it again.

To select the elements I haven't scanned yet I use the following query:

select * from table1 where url not in (select url from table2);

This gives me all the rows in table1 that haven't been put into table2.  
Now, this works but takes ages to run.   Can anyone help me with a 
better, quicker query?

Thanks,
  Chris


More information about the clug-tech mailing list