On Fri, 10 May 2002, large scale wrote: > Hi, > > I have two tables, one has 25000 rows and the other > has 6.5 million rows. > > (25000 rows) > table1 > (id text, > start int, > stop int) > > with seperate index on three individual fiels. > > 6.5 million rows > table2 > (id text, > start int, > stop int) > > with seperate index on three individual fields.
We'll start with the standard questions: Have you vacuum analyzed? What version are you running? (if it's less than 7.2, you may want to see about upgrading) If you do a set enable_seqscan=false; what does the explain show then? I'd be interested in know if 1024601931 is even remotely a valid number of rows from that join as well (which is about .5% of an entire cartesian join if my math is right). Perhaps some exists style thing would be faster since that would at least presumably be able to stop when it found a matching table2 row for a particular table1 id. ---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html