Re: New GUC to sample log queries

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Adrien Nayrat <adrien.nayrat@anayrat.info>
Cc: David Rowley <david.rowley@2ndquadrant.com>, PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Date: 2018-05-31T13:22:16Z
Lists: pgsql-hackers
On Thu, May 31, 2018 at 02:37:07PM +0200, Adrien Nayrat wrote:
> On 05/31/2018 03:34 AM, David Rowley wrote:
>> On 31 May 2018 at 06:44, Adrien Nayrat <adrien.nayrat@anayrat.info> wrote:
>>> Here is a naive SELECT only bench with a dataset which fit in ram (scale factor
>>> = 100) and PGDATA and log on a ramdisk:
>>> shared_buffers = 4GB
>>> seq_page_cost = random_page_cost = 1.0
>>> logging_collector = on (no rotation)
>> 
>> It would be better to just: SELECT 1; to try to get the true overhead
>> of the additional logging code.
> 
> Right, I wonder why I didn't have the idea :)

Using prepared statements help also in reducing the load with
unnecessary planning.
--
Michael

Commits

  1. Use pg_strong_random() to select each server process's random seed.

  2. Use a separate random seed for SQL random()/setseed() functions.

  3. Marginal performance hacking in erand48.c.

  4. Fix latent problem with pg_jrand48().

  5. Silence compiler warning

  6. Add log_statement_sample_rate parameter