Re: [PERFORM] Different query plans for the same query

2009-09-23 Thread Hell, Robert
Hi Tom, it would be really hard for us to change the underlying tables and the executed query. Is there any other way for us to avoid the really bad query (e.g. a hint for the planner)? Regards, Robert Hell -Ursprüngliche Nachricht- Von: Tom Lane [mailto:t...@sss.pgh.pa.us] Gesendet:

Re: [PERFORM] Use of sequence rather than index scan for one text column on one instance of a database

2009-09-23 Thread Tom Lane
Bill Kirtley writes: > On the main production database, a select looking at the email column > winds up scanning the whole table: > ... where on that same database selecting on the 'key' column uses the > index as expected: That's just bizarre. I assume that setting enable_seqscan = off does

Re: [PERFORM] Slow query after upgrade to 8.4

2009-09-23 Thread Tom Lane
Jared Beck writes: > Hello postgres wizards, > We recently upgraded from 8.1.5 to 8.4 > We have a query (slow_query.sql) which took about 9s on 8.1.5 > On 8.4, the same query takes 17.7 minutes. One thing that is hobbling the performane on 8.4 is that you have work_mem set to only 1MB (you had it

[PERFORM] Use of sequence rather than index scan for one text column on one instance of a database

2009-09-23 Thread Bill Kirtley
Hello- I've discovered that lookups on one column in one instance of my database performs badly. The table has columns 'email' and 'key', both of type 'character varying(255)', and both with btree indices. The table has ~ 500k rows, and no rows of either column are blank or null, and all

[PERFORM] Slow query after upgrade to 8.4

2009-09-23 Thread Jared Beck
Hello postgres wizards, We recently upgraded from 8.1.5 to 8.4 We have a query (slow_query.sql) which took about 9s on 8.1.5 On 8.4, the same query takes 17.7 minutes. The code which generated this query is written to support the calculation of arbitrary arithmetic expressions across "variables"

Re: [PERFORM] Slow query after upgrade to 8.4

2009-09-23 Thread Greg Williamson
Jared -- Forgive the top-posting -- a challenged reader. I see this in the 8.4 analyze: Merge Cond: (cli.clientid = dv118488y0.clientid) Join Filter: ((dv118488y0.variableid = v118488y0.variableid) AND (dv118488y0.cycleid = c1.cycleid) AND (dv118488y0.unitid = u.uni

[PERFORM] Slow query after upgrade to 8.4

2009-09-23 Thread Jared Beck
Hello postgres wizards, We recently upgraded from 8.1.5 to 8.4 We have a query (slow_query.sql) which took about 9s on 8.1.5 On 8.4, the same query takes 17.7 minutes. The code which generated this query is written to support the calculation of arbitrary arithmetic expressions across "variables"

Re: [PERFORM] High CPU load on Postgres Server during Peak times!!!!

2009-09-23 Thread Scott Marlowe
On Wed, Sep 23, 2009 at 12:25 PM, Shiva Raman wrote: First let me say that upgrading to a later version is likely going to help as much as anything else you're likely to pick up from this discussion. Not that this discussion isn't worthwhile, it is. > If you run a 'ps ax|grep post' do you see a

Re: [PERFORM] High CPU load on Postgres Server during Peak times!!!!

2009-09-23 Thread Karl Denninger
Fernando Hevia wrote: User Access Total Number of Users is 500 Maximum number of Concurrent users will be 500 during peak time Off Peak time the maximum number of concurrent user will be around 150 to 200. >>> A connection pooler like pgpool or pgbouncer

Re: [PERFORM] High CPU load on Postgres Server during Peak times!!!!

2009-09-23 Thread Fernando Hevia
>>> >>> User Access >>> Total Number of Users is 500 >>> Maximum number of Concurrent users will be 500 during peak time >>> Off Peak time the maximum number of concurrent user will be >>> around 150 to 200. >>> >> >>A connection pooler like pgpool or pgbouncer would considerably reduce the >>burde

Re: [PERFORM] High CPU load on Postgres Server during Peak times!!!!

2009-09-23 Thread Andy Colson
Shiva Raman wrote: /If you run a 'ps ax|grep post' do you see anything that says 'idle in transaction'? (I hope that old of version will show it. my processes show up as postgres not postmaster)/ Lots of requests shows as 'idle in transaction'. Eww. I think that's bad. A connection that

Re: [PERFORM] High CPU load on Postgres Server during Peak times!!!!

2009-09-23 Thread Shiva Raman
Hi Thanks for your mail. *Some quick advice:* * * *>* *> clusternode2:~ # rpm -qa | grep postgres* *> postgresql-devel-8.1.9-1.2* *> postgresql-8.1.9-1.2* *> postgresql-docs-8.1.9-1.2* *> postgresql-server-8.1.9-1.2* *> postgresql-libs-64bit-8.1.9-1.2* *> postgresql-libs-8.1.9-1.2* *> p

Re: [PERFORM] High CPU load on Postgres Server during Peak times!!!!

2009-09-23 Thread Shiva Raman
Hi Thanks a lot for the reply. *I see you are on a pretty old version of pg. Are you vacuuming regularly?* Yes, Vaccuuming is done every day morning at 06 am It is running perfectly fine. * * *If you run a 'ps ax|grep post' do you see anything that says 'idle in transaction'? (I hope t

Re: [PERFORM] statement stats extra load?

2009-09-23 Thread Magnus Hagander
On Tue, Sep 22, 2009 at 15:19, Alan McKay wrote: > On Tue, Sep 22, 2009 at 2:42 AM, Magnus Hagander wrote: >> That's not true at all. >> >> If you have many relations in your cluster that have at some point been >> touched, the starts collector can create a *significant* load on the I/o >> system