Re: [PERFORM] performance question (something to do w/

2006-05-09 Thread Kenneth Marshall
On Mon, May 08, 2006 at 12:50:13PM -0500, Jim C. Nasby wrote: > On Mon, May 08, 2006 at 10:42:21AM -0700, Mark Lewis wrote: > > Doing a SELECT with a large list of variables inside an IN runs slowly > > on every database we've tested. We've tested mostly in Oracle and > > PostgreSQL, and both get

Re: [PERFORM] performance question (something to do w/ parameterized

2006-05-08 Thread Klint Gore
On Mon, 08 May 2006 19:37:37 -0400, Tom Lane <[EMAIL PROTECTED]> wrote: > Jeffrey Tenny <[EMAIL PROTECTED]> writes: > > The server was already running with random_page_cost=2 today for all tests, > > because of > > the mods I've made to improve other problem queries in the past (my > > settings n

Re: [PERFORM] performance question (something to do w/ parameterized

2006-05-08 Thread Tom Lane
Jeffrey Tenny <[EMAIL PROTECTED]> writes: > The server was already running with random_page_cost=2 today for all tests, > because of > the mods I've made to improve other problem queries in the past (my settings > noted below, and > before in another msg on this topic). > So to nail this particu

Re: [PERFORM] performance question (something to do w/ parameterized

2006-05-08 Thread Jeffrey Tenny
Tom Lane wrote: > Jeffrey Tenny <[EMAIL PROTECTED]> writes: >> I tried the seqscan disabling and got what sounds like the desired plan: >> Sort (cost=54900.62..54940.29 rows=1587 width=16) (actual time=20.208..22.138 rows=677 loops=1) >> Sort Key: f, c >> -> Index Scan using x_f_idx, x_

Re: [PERFORM] performance question (something to do w/ parameterized

2006-05-08 Thread Tom Lane
Jeffrey Tenny <[EMAIL PROTECTED]> writes: > I tried the seqscan disabling and got what sounds like the desired plan: > Sort (cost=54900.62..54940.29 rows=1587 width=16) (actual > time=20.208..22.138 rows=677 loops=1) > Sort Key: f, c > -> Index Scan using x_f_idx, x_f_idx, ... > (cos

Re: [PERFORM] performance question (something to do w/ parameterized

2006-05-08 Thread Jeffrey Tenny
re my question here: what would be the JDBC-proper technique, my app is all jdbc. Jeffrey Tenny wrote: 1) is there a way to enable that for a single query in a multi-query transaction? ---(end of broadcast)--- TIP 3: Have you checked our extensi

Re: [PERFORM] performance question (something to do w/ parameterized

2006-05-08 Thread Jeffrey Tenny
I tried the seqscan disabling and got what sounds like the desired plan: Sort (cost=54900.62..54940.29 rows=1587 width=16) (actual time=20.208..22.138 rows=677 loops=1) Sort Key: f, c -> Index Scan using x_f_idx, x_f_idx, ... (cost=0.00..54056.96 rows=1587 width=16) (actual time=1.048

Re: [PERFORM] performance question (something to do w/ parameterized

2006-05-08 Thread Tom Lane
Jeffrey Tenny <[EMAIL PROTECTED]> writes: > I dropped the multicolumn index 'testindex2', and a new explain analyze > looks like this: > Sort (cost=35730.71..35768.28 rows=1503 width=16) (actual > time=962.555..964.467 rows=677 loops=1) > Sort Key: f, c > -> Seq Scan on x (cost=0.0

Re: [PERFORM] performance question (something to do w/ parameterized

2006-05-08 Thread Jeffrey Tenny
The original set of indexes were: Indexes: "x_c_idx" btree (c) "x_f_idx" btree (f) "testindex2" btree (f, c) I dropped the multicolumn index 'testindex2', and a new explain analyze looks like this: Sort (cost=35730.71..35768.28 rows=1503 width=16) (actual time=962.555..964.467

Re: [PERFORM] performance question (something to do w/ parameterized

2006-05-08 Thread Tom Lane
Jeffrey Tenny <[EMAIL PROTECTED]> writes: > Well, since I don't know the exact parameter values, just substituting > 1-650 for $1-$650, I get: > Index Scan using testindex2 on x (cost=0.00..34964.52 rows=1503 > width=16) (actual time=0.201..968.252 rows=677 loops=1) > Filter: ((f = 1) OR

Re: [PERFORM] performance question (something to do w/ parameterized

2006-05-08 Thread Jeffrey Tenny
Mark Lewis wrote: Doing a SELECT with a large list of variables inside an IN runs slowly on every database we've tested. We've tested mostly in Oracle and PostgreSQL, and both get very slow very quickly (actually Oracle refuses to process the query at all after it gets too many bind parameters).

Re: [PERFORM] performance question (something to do w/ parameterized

2006-05-08 Thread Jeffrey Tenny
Well, since I don't know the exact parameter values, just substituting 1-650 for $1-$650, I get: Index Scan using testindex2 on x (cost=0.00..34964.52 rows=1503 width=16) (actual time=0.201..968.252 rows=677 loops=1) Filter: ((f = 1) OR (f = 2) OR (f = 3) OR (f = 4) ... So index usage is

Re: [PERFORM] performance question (something to do w/

2006-05-08 Thread Tom Lane
"Jim C. Nasby" <[EMAIL PROTECTED]> writes: > On Mon, May 08, 2006 at 10:42:21AM -0700, Mark Lewis wrote: >> Doing a SELECT with a large list of variables inside an IN runs slowly >> on every database we've tested. We've tested mostly in Oracle and >> PostgreSQL, and both get very slow very quickly

Re: [PERFORM] performance question (something to do w/

2006-05-08 Thread Jim C. Nasby
On Mon, May 08, 2006 at 10:42:21AM -0700, Mark Lewis wrote: > Doing a SELECT with a large list of variables inside an IN runs slowly > on every database we've tested. We've tested mostly in Oracle and > PostgreSQL, and both get very slow very quickly (actually Oracle refuses > to process the query

Re: [PERFORM] performance question (something to do w/

2006-05-08 Thread Mark Lewis
Doing a SELECT with a large list of variables inside an IN runs slowly on every database we've tested. We've tested mostly in Oracle and PostgreSQL, and both get very slow very quickly (actually Oracle refuses to process the query at all after it gets too many bind parameters). In our case, we ha

Re: [PERFORM] performance question (something to do w/ parameterized stmts?, wrong index types?)

2006-05-08 Thread Jim C. Nasby
What's EXPLAIN ANALYZE show? On Mon, May 08, 2006 at 01:29:28PM -0400, Jeffrey Tenny wrote: > Why does this query take so long? (PostgreSQL 8.0.3, FC4) > Hopefully I have provided enough information below. > > LOG: statement: SELECT * FROM x WHERE f IN > ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12

[PERFORM] performance question (something to do w/ parameterized stmts?, wrong index types?)

2006-05-08 Thread Jeffrey Tenny
Why does this query take so long? (PostgreSQL 8.0.3, FC4) Hopefully I have provided enough information below. LOG: statement: SELECT * FROM x WHERE f IN ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,\ $25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$3