Re: The same query - much different runtimes

From: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
To: Johann Spies <johann(dot)spies(at)gmail(dot)com>
Cc: pgsql-performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: The same query - much different runtimes
Date: 2014-04-07 10:58:45
Message-ID: CABOikdPQqi5+DgV_CGuxG91cMojQX7ZQ9sxNx7SXKSiER_EXbg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Mon, Apr 7, 2014 at 3:55 PM, Johann Spies <johann(dot)spies(at)gmail(dot)com> wrote:

>
>
> I then ran the query and the result was produced in about the same time as
> (2945 ms).
>
> What can cause such a huge discrepancy?
>

May be when you reran the query, most of the data blocks were cached either
in the shared buffers or the OS cache. That could drastically improve the
performance. I can see a large number of shared buffer hits in the explain
analyze output of the query ran through psql session.

Thanks,
Pavan

--
Pavan Deolasee
http://www.linkedin.com/in/pavandeolasee

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Albe Laurenz 2014-04-07 12:06:30 Re: Batch update query performance
Previous Message Ryan Johnson 2014-04-07 10:52:54 Re: SSI slows down over time