Re: Repeated Query is much slower in PostgreSQL8.2.4 than DB2 9.1

From: ning <mailxiening(at)gmail(dot)com>
To: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Repeated Query is much slower in PostgreSQL8.2.4 than DB2 9.1
Date: 2009-07-15 08:51:50
Message-ID: 27f31620907150151l76e77882s2e0b61e42795d5b3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi Craig,

The log is really long, but I compared the result of "explain analyze"
for first and later executions, except for 3 "time=XXX" numbers, they
are identical.
I agree with you that PostgreSQL is doing different level of caching,
I just wonder if there is any way to speed up PostgreSQL in this
scenario, which is a wrong way perhaps.

Thank you.
Ning

On Wed, Jul 15, 2009 at 5:27 PM, Craig
Ringer<craig(at)postnewspapers(dot)com(dot)au> wrote:
> On Wed, 2009-07-15 at 12:10 +0900, ning wrote:
>
>> First execution: PostgreSQL 0.006277 seconds / DB2 0.009028 seconds
>> Second execution: PostgreSQL 0.005932 seconds / DB2 0.000332 seconds
>
> Actually, on second thoughts that looks a lot like DB2 is caching the
> query results and is just returning the cached results when you repeat
> the query.
>
> I'm not sure to what extent PostgreSQL is capable of result caching, but
> I'd be surprised if it could do as much as DB2.
>
> --
> Craig Ringer
>
>

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message ning 2009-07-15 09:05:44 Re: Repeated Query is much slower in PostgreSQL8.2.4 than DB2 9.1
Previous Message Alex 2009-07-15 08:44:06 Strange memory behavior with rails - caching in connection?