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

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: mpokky(at)126(dot)com
Cc: Nandakumar M <m(dot)nanda92(at)gmail(dot)com>, "pgsql-performa(dot)" <pgsql-performance(at)postgresql(dot)org>, guillaume(dot)poussel(at)sogeti(dot)com
Subject: Re: Query is slow when run for first time; subsequent execution is fast
Date: 2018-09-05 00:35:19
Message-ID: CAMkU=1xufgsgEL148=c+Bu-BMYzQy12X2YASdKAXoz5ns5bz4w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Tue, Sep 4, 2018 at 3:16 AM jimmy <mpokky(at)126(dot)com> wrote:

> 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.
>

Starting with PostgreSQL version 11 (to be released soon), you can use
pg_prewarm.autoprewarm.

Until then, maybe this:
https://superuser.com/questions/502160/run-a-scheduled-task-after-a-windows-service-is-started

I've tested neither one.

Cheers,

Jeff

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Dinesh Kumar 2018-09-05 04:21:45 Re: Performance difference in accessing differrent columns in a Postgres Table
Previous Message Laurenz Albe 2018-09-04 19:15:19 Re: Inconsistent query times and spiky CPU with GIN tsvector search