Re: how to know whether query data from memory after pg_prewarm

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: jimmy <mpokky(at)126(dot)com>
Cc: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: how to know whether query data from memory after pg_prewarm
Date: 2018-09-19 03:29:57
Message-ID: CAEepm=15-5d72_eQTqPYwte7G7+rhnxZ1fFbceC7+MR49zKyQw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Sep 19, 2018 at 1:35 PM jimmy <mpokky(at)126(dot)com> wrote:
> I use select pg_prewarm('table1','read','main') to load data of table1 into the memory.
> when I use select count(1) from table1 group by aa to query data.
> I find the speed of query is not fast, I wonder whether it query data from memory.
> And it is slower than Oracle, both of Oracle and Postgresql has same table and count of data.
> when pg_prewarm use 'read' mode, the data is put into the OS cache, how to examine the table which is pg_prewarmed into the OS cache .
> I know pg_buffercache ,but it just examine the table in the shared buffer of Postgresql, not the table in the OS cache.

This is a quick and dirty hack, but it might do what you want:

https://github.com/macdice/pgdata_mincore

Tested on FreeBSD, not sure how well it'll travel.

--
Thomas Munro
http://www.enterprisedb.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Güttler 2018-09-19 06:30:47 Replicate Tables from SAP (DB2/HANA) to PostgreSQL
Previous Message Thomas Munro 2018-09-19 03:21:53 Re: Why the sql is not executed in parallel mode