Re: same query in high number of times

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Peter Alban <peter(dot)alban2(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: same query in high number of times
Date: 2009-06-21 17:42:23
Message-ID: 603c8f070906211042k4dc3383dm10c9475eab195182@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Sun, Jun 21, 2009 at 6:54 AM, Peter Alban<peter(dot)alban2(at)gmail(dot)com> wrote:
> Should PG realize that if the table data is same should the query result set
> also be the same ?

No. That's not so easy to implement as you might think. Saving the
results of each previous query in case someone issues the same query
again without having changed anything in the meantime would probably
cost more in performance on average that you'd get out of it.

> Where do I see what the PG does ? I can see now the query's that take long
> time ,but do not have information about what the optimizer does neither when
> the DB decides about to table scan or cache ?

Can't you get this from EXPLAIN and EXPLAIN ANALYZE?

...Robert

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Peter Alban 2009-06-21 18:28:15 Re: same query in high number of times
Previous Message Justin Graf 2009-06-21 14:01:05 Re: same query in high number of times