Re: Query is slow when run for first time; subsequent execution is fast

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: Query is slow when run for first time; subsequent execution is fast
Date: 2018-01-16 12:20:39
Message-ID: d46ddd88-6eaf-33a0-0b7b-672b5316262e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Nandakumar M schrieb am 12.01.2018 um 09:03:
> Even if I close a connection and open a new one and execute the same
> query, the planning time is considerably less than the first time.
> Only when I restart the Postgres server then I face high planning
> time again.

Yes, because the data is cached by Postgres ("shared_buffers") and the filesystem.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Nicolas Charles 2018-01-16 15:08:01 Re: HDD vs SSD without explanation
Previous Message Nandakumar M 2018-01-16 11:46:03 Fwd: Re: Query is slow when run for first time; subsequent execution is fast