public inbox for [email protected]  
help / color / mirror / Atom feed
From: Andrey M. Borodin <[email protected]>
To: Vladimir Churyukin <[email protected]>
Cc: [email protected]
Subject: Re: Bypassing shared_buffers
Date: Mon, 19 Jun 2023 12:47:40 +0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAFSGpE3y_oMK1uHhcHxGxBxs+KrjMMdGrE+6HHOu0vttVET0UQ@mail.gmail.com>
References: <CAFSGpE3y_oMK1uHhcHxGxBxs+KrjMMdGrE+6HHOu0vttVET0UQ@mail.gmail.com>

Hi!

> On 15 Jun 2023, at 03:57, Vladimir Churyukin <[email protected]> wrote:
> 
> Hello,
> 
> There is often a need to test particular queries executed in the worst-case scenario, i.e. right after a server restart or with no or minimal amount of data in shared buffers. In Postgres it's currently hard to achieve (other than to restart the server completely to run a single query, which is not practical). Is there a simple way to introduce a GUC variable that makes queries bypass shared_buffers and always read from storage? It would make testing like that orders of magnitude simpler. I mean, are there serious technical obstacles or any other objections to that idea in principle? 

Few months ago I implemented "drop of caches" to demonstrate basic structure of shared buffers [0]. The patch is very unsafe in the form is was implemented, but if you think that functionality is really useful (it was not intended to be) I can try to do the same as extension.

it worked like "SELECT FlushAllBuffers();" and what is done resembles checkpoint, but evicts every buffer that can be evicted. Obviously, emptied buffers would be immediately reused by concurrent sessions.


Best regards, Andrey Borodin.

[0] https://www.youtube.com/watch?v=u8BAOqeKnwY





view thread (2+ messages)

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: Bypassing shared_buffers
  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