Re: same query in high number of times - Mailing list pgsql-performance

From Robert Haas
Subject Re: same query in high number of times
Date
Msg-id 603c8f070906211042k4dc3383dm10c9475eab195182@mail.gmail.com
Whole thread Raw
In response to same query in high number of times  (Peter Alban <peter.alban2@gmail.com>)
Responses Re: same query in high number of times  (Peter Alban <peter.alban2@gmail.com>)
List pgsql-performance
On Sun, Jun 21, 2009 at 6:54 AM, Peter Alban<peter.alban2@gmail.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

pgsql-performance by date:

Previous
From: "Justin Graf"
Date:
Subject: Re: same query in high number of times
Next
From: Peter Alban
Date:
Subject: Re: same query in high number of times