Re: [PERFORM] REPOST: Nested loops row estimates always too high

2007-09-25 Thread Tom Lane
Ow Mun Heng <[EMAIL PROTECTED]> writes: > Where can I erad more about this new "feature"? http://developer.postgresql.org/pgdocs/postgres/sql-createfunction.html http://developer.postgresql.org/pgdocs/postgres/ always has a current snapshot of CVS-HEAD documentation... re

Re: [PERFORM] REPOST: Nested loops row estimates always too high

2007-09-25 Thread Ow Mun Heng
On Tue, 2007-09-25 at 11:31 +0200, Steinar H. Gunderson wrote: > On Tue, Sep 25, 2007 at 12:53:55AM -0400, Carlo Stonebanks wrote: > > My problem is that I think that SRF's are causing my problems. The SRF's > > gets an automatic row estimate of 1000 rows. Add a condition to it, the > > planner gue

Re: [PERFORM] query io stats and finding a slow query

2007-09-25 Thread Bryan Murphy
We use pgfouine (http://pgfouine.projects.postgresql.org/). I currently have postgres log every query that takes longer than 100ms, roll the log files every 24 hours, and run pgfouine nightly. I check it every couple of mornings and this gives me a pretty good picture of who misbehaved over the l

Re: [PERFORM] query io stats and finding a slow query

2007-09-25 Thread Kamen Stanev
Thanks for the reply. Here is what I found about my problem. When i set the log_min_duration_statement and in the moments when the server performance is degrading I can see that almost all queries run very slowly (10-100 times slower). At first I thought that there is exclusive lock on one of the

Re: [PERFORM] Attempting to disable count triggers on cleanup

2007-09-25 Thread Dave Cramer
hubert depesz lubaczewski wrote: On Tue, Sep 25, 2007 at 07:08:42AM -0400, Dave Cramer wrote: ERROR: deadlock detected DETAIL: Process 23063 waits for ExclusiveLock on tuple (20502,48) of relation 48999028 of database 14510214; blocked by process 23110. Process 23110 waits for ShareLock on

Re: [PERFORM] Attempting to disable count triggers on cleanup

2007-09-25 Thread hubert depesz lubaczewski
On Tue, Sep 25, 2007 at 07:08:42AM -0400, Dave Cramer wrote: > ERROR: deadlock detected > DETAIL: Process 23063 waits for ExclusiveLock on tuple (20502,48) of > relation 48999028 of database 14510214; blocked by process 23110. > Process 23110 waits for ShareLock on transaction 1427023217; blocke

[PERFORM] Attempting to disable count triggers on cleanup

2007-09-25 Thread Dave Cramer
I have a database that we want to keep track of counts of rows. We have triggers on the rows which increment, and decrement a count table. In order to speed up deleting many rows we have added the following if user != 'mocospace_cleanup' then

Re: [PERFORM] REPOST: Nested loops row estimates always too high

2007-09-25 Thread Steinar H. Gunderson
On Tue, Sep 25, 2007 at 12:53:55AM -0400, Carlo Stonebanks wrote: > My problem is that I think that SRF's are causing my problems. The SRF's > gets an automatic row estimate of 1000 rows. Add a condition to it, the > planner guesses 333 rows. Even at 333, this is an overestimate of the number > of