public inbox for [email protected]
help / color / mirror / Atom feedFrom: Christoph Moench-Tegeder <[email protected]>
To: Ron Johnson <[email protected]>
Cc: pgsql-general <[email protected]>
Subject: Re: Loading the latest N rows into the cache seems way too fast.
Date: Mon, 17 Feb 2025 22:25:08 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <CANzqJaBTPgTJ_M3dGiOa5H-FvAo71oCCa1QHejbzK+joKdrSyw@mail.gmail.com>
References: <CANzqJaBTPgTJ_M3dGiOa5H-FvAo71oCCa1QHejbzK+joKdrSyw@mail.gmail.com>
## Ron Johnson ([email protected]):
> Loading 200K rows is more than 200MB. I expected this "prewarm" statement
> to take much longer than 1/2 second. Am I still in the dark ages of
> computer speed, or is this statement not doing what I hope it's doing?
>
> $ time psql -h foo bar -Xc "DO \$\$ BEGIN PERFORM * FROM mytbl ORDER BY id
> DESC LIMIT 200000 ; END \$\$;"
You can check what that statement does - e.g. in pg_stat_statements,
or (on an idle database, so the effects aren't lost in the noise) in
pg_stat_database or pg_statio_user_tables.
Between what the storage components of the last decade (e.g. those
SATA SSDs which are already being replaced in the market by NVME)
can deliver (>400MB/s, often marketed as ">500 MB/s" but on SATA that's
optimistic) and the fact that there are most likely some blocks
in the database' buffer and/or the OS buffer, the observed throughput
is not neccessarily unrealistic. With modern "server" hardware, getting
throughput in the "gigabytes per second" range is considered normal and
expected.
Regards,
Christoph
--
Spare Space
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: [email protected]
Cc: [email protected], [email protected]
Subject: Re: Loading the latest N rows into the cache seems way too fast.
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox