pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-performance@lists.postgresql.org
Subject: Re: Query is slow when run for first time; subsequent execution is fast
Date: Tue, 16 Jan 2018 13:20:39 +0100
Message-ID: <d46ddd88-6eaf-33a0-0b7b-672b5316262e@gmx.net> (raw)
In-Reply-To: <CANcFUu611kaPfH+2F3pxGNX3x9jM-QiCTuS+4pzTeLL50+5s3w@mail.gmail.com>
References: <CANcFUu4e1zZQCvt9rjQGNUFV-kxv7F8Somk5Zgq2tXCO9dZhDg@mail.gmail.com>
	<CAMkU=1yiULP9Gdy1pT2bpVomi4cinNGz8d7-7y+chBOQFg3f6Q@mail.gmail.com>
	<CANcFUu611kaPfH+2F3pxGNX3x9jM-QiCTuS+4pzTeLL50+5s3w@mail.gmail.com>

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.






view thread (13+ messages)  latest in thread

Message-ID: <d46ddd88-6eaf-33a0-0b7b-672b5316262e@gmx.net>
Permalink:  ../d46ddd88-6eaf-33a0-0b7b-672b5316262e@gmx.net/
Also on:    postgresql.org/message-id/d46ddd88-6eaf-33a0-0b7b-672b5316262e@gmx.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: spam_eater@gmx.net, pgsql-performance@lists.postgresql.org
  Subject: Re: Query is slow when run for first time; subsequent execution is fast
  In-Reply-To: <d46ddd88-6eaf-33a0-0b7b-672b5316262e@gmx.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox