Re: Re: low performance

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andreas Wernitznig <andreas(at)insilico(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Re: low performance
Date: 2001-08-22 23:19:42
Message-ID: 21968.998522382@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Andreas Wernitznig <andreas(at)insilico(dot)com> writes:
> I took option 1 and managed to create a profile of a slow and a fast run:

It's difficult to compare these profiles, because they seem to be taken
over very different numbers of queries --- did you let the "fast" run
process more queries than the "slow" one?

However, I think what is happening is that some queries are being done
as indexscans in the fast case and seqscans in the slow case. The
ratio of ExecIndexScan calls to ExecSeqScan calls is vastly different
in the two profiles.

It looks like you are doing vacuums fairly frequently, so I speculate
that the statistics gathered by vacuum are changing just enough to alter
the planner's choice between indexscan and seqscan for some
often-executed query type. Evidently the planner is guessing the costs
to be nearly the same, so a small change in stats might tip the choice
--- but in reality the costs are quite a bit different, thus you observe
fast and slow behavior.

The next step should be to get EXPLAIN results for the queries used
by your application in both fast and slow states. This will help us
narrow down where the planner's misprediction is occurring.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message pgsql-bugs 2001-08-23 00:17:36 timestamps cannot be created without time zones
Previous Message Andreas Wernitznig 2001-08-22 21:35:20 Re: Re: low performance