[SQL] Speed or configuration

2000-08-21 Thread Franz J Fortuny
The Hermit Hacker wrote: "use cut-n-paste please, and send us the results of the EXPLAIN ... stuff like the cost estimates and whatnot tell us *so* much ..." This is it: exis=# \d pvdprcod NUMART| integer | not null NUMDEP| smallint| not null NUMPRO| smallint| not nul

RE: [SQL] Speed or configuration

2000-08-20 Thread The Hermit Hacker
On Sun, 20 Aug 2000, Franz J Fortuny wrote: > > > > "What version of Postgres are you using, and what does > EXPLAIN show > as the query plan for this query? How many tableY rows > is the sub- > query likely to produce, and how many matches do you > expect to get > from tableX?" > > Version:

RE: [SQL] Speed or configuration

2000-08-20 Thread Franz J Fortuny
"First question(s) I have is what version of PostgreSQL? what hardware is the commercial SQL server running on? PostgreSQL? memory, cpu, hard drives, etc?" Version: postgresql-7.0.2-2.i386.rpm Hardware: Same Hardware for all SQL Servers (same machine, of course, one SQL Server is idle while the

RE: [SQL] Speed or configuration

2000-08-20 Thread Franz J Fortuny
"What version of Postgres are you using, and what does EXPLAIN show as the query plan for this query? How many tableY rows is the sub- query likely to produce, and how many matches do you expect to get from tableX?" Version: postgresql-7.0.2-2.i386.rpm Explain: Scan table, scan table. (Plus t

Re: [SQL] Speed or configuration

2000-08-20 Thread Stephan Szabo
(It won't really be forever, just probably a really long time) You can usually get around it by rewriting the query to use EXISTS rather than IN. Stephan Szabo [EMAIL PROTECTED] On Sun, 20 Aug 2000, Franz J Fortuny wrote: > At our company we are presently using a commercial > database that gen

Re: [SQL] Speed or configuration

2000-08-20 Thread Tom Lane
"Franz J Fortuny" <[EMAIL PROTECTED]> writes: > [ this query is slow: ] > select xx1,xx2,xx3 from tableX > where field1 in > (select field1 from tableY where > field2=NNN and field3=NNN2 and field4=NNN4) What version of Postgres are you using, and what does EXPLAIN show as the query plan for this

Re: [SQL] Speed or configuration

2000-08-20 Thread The Hermit Hacker
On Sun, 20 Aug 2000, Franz J Fortuny wrote: > At our company we are presently using a commercial > database that generates results from this query: > > select xx1,xx2,xx3 from tableX > where field1 in > (select field1 from tableY where > field2=NNN and field3=NNN2 and field4=NNN4) > > tableX ha

[SQL] Speed or configuration

2000-08-20 Thread Franz J Fortuny
At our company we are presently using a commercial database that generates results from this query: select xx1,xx2,xx3 from tableX where field1 in (select field1 from tableY where field2=NNN and field3=NNN2 and field4=NNN4) tableX has 790,000 rows, and an index on field1 tableY has abou 175,000