Re: Cached Query Plans (was: global prepared statements)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>
Cc: "Dawid Kuroczko" <qnex42(at)gmail(dot)com>, Perez <arturo(at)ethicist(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Cached Query Plans (was: global prepared statements)
Date: 2008-04-13 02:17:44
Message-ID: 14355.1208053064@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Jonah H. Harris" <jonah(dot)harris(at)gmail(dot)com> writes:
> On Sat, Apr 12, 2008 at 2:19 PM, Dawid Kuroczko <qnex42(at)gmail(dot)com> wrote:
>> There are other benefits as well. Oracle lets you see the statistics associated
>> with given plans. So you can see how many times given (cached) query was
>> executed, how much resources did it consume and do on.

> Yes, and it also uses that data at both the statement and column level
> to determine what needs more analysis to help build better plans in
> the future.

>> Right now the only way of getting such information from PostgreSQL is by
>> logging all queries and analyzing logs. The current_query column of
>> pg_stat_activity is useless as the (prepared) queries are usually so short
>> lived that you will see one execution out of thousands happening.

> Yes, this is worthless on large active databases. The logging
> overhead alone starts to affect performance.

But somehow, all that stuff with cached plans is free?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-04-13 03:07:10 Re: Re: [COMMITTERS] pgsql: Strengthen warnings about using pg_dump's -i option.
Previous Message Jonah H. Harris 2008-04-13 01:42:05 Re: Cached Query Plans (was: global prepared statements)