pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: jimmy <mpokky@126.com>
To: m.nanda92@gmail.com
To: pgsql-performance@postgresql.org
To: guillaume.poussel@sogeti.com
Cc: jeff.janes@gmail.com
Subject: RE: Query is slow when run for first time; subsequent execution is fast
Date: Tue, 4 Sep 2018 15:16:10 +0800 (CST)
Message-ID: <261af533.7aa3.165a3704c8b.Coremail.mpokky@126.com> (raw)

On windows, how to put an entry in my db startup script to run this query (pg_prewarm) immediately after startng the server, and let the query warm the cache itself.
After starting the server, I want to know what is  the server, and it is the database I restarted or windows system?
Thank you.  


>Hi,
>On 17 Jan 2018 12:55, "POUSSEL, Guillaume" <guillaume(dot)poussel(at)sogeti(dot)com>
>wrote:
>Are you on Windows or Linux? I’m on Windows and wondering if the issue is
>the same on Linux?
>I have experienced this on Mac and Linux machines.
>You can try pg_prewarm, on pg_statistic table and its index.  But I'd
>probably just put an entry in my db startup script to run this query
>immediately after startng the server, and let the query warm the cache
>itself.




>I will try this suggestion and get back on the thread. Is pg_statistic the
>only table to be pre cached? Pls let me know if any other table/index needs
>to be pre warmed.
>
>
>Btw, I don't running a "select * from pg_statistic" will fill the shared
>buffer. Only 256 kb of data will be cached during sequential scans. I will
>try pg_prewarm
>
>
>Why do you restart your database often
>
>
>Postgres is bundled with our application and deployed by our client.
>Starting / stopping the server is not under my control.
>
>
>Regards,
>Nanda

view thread (13+ messages)  latest in thread

Message-ID: <261af533.7aa3.165a3704c8b.Coremail.mpokky@126.com>
Permalink:  ../261af533.7aa3.165a3704c8b.Coremail.mpokky@126.com/
Also on:    postgresql.org/message-id/261af533.7aa3.165a3704c8b.Coremail.mpokky@126.com

 · 

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: mpokky@126.com, m.nanda92@gmail.com, guillaume.poussel@sogeti.com, jeff.janes@gmail.com
  Subject: RE: Query is slow when run for first time; subsequent execution is fast
  In-Reply-To: <261af533.7aa3.165a3704c8b.Coremail.mpokky@126.com>

* 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