pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dean Rasheed <dean.a.rasheed@gmail.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pgbench: Function to generate random permutations.
Date: Tue, 06 Apr 2021 10:52:28 +0000
Message-ID: <E1lTjJs-0005R3-Bd@gemulon.postgresql.org> (raw)

pgbench: Function to generate random permutations.

This adds a new function, permute(), that generates pseudorandom
permutations of arbitrary sizes. This can be used to randomly shuffle
a set of values to remove unwanted correlations. For example,
permuting the output from a non-uniform random distribution so that
all the most common values aren't collocated, allowing more realistic
tests to be performed.

Formerly, hash() was recommended for this purpose, but that suffers
from collisions that might alter the distribution, so recommend
permute() for this purpose instead.

Fabien Coelho and Hironobu Suzuki, with additional hacking be me.
Reviewed by Thomas Munro, Alvaro Herrera and Muhammad Usama.

Discussion: https://postgr.es/m/alpine.DEB.2.21.1807280944370.5142@lancre

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6b258e3d688db14aadb58dde2a72939362310684

Modified Files
--------------
doc/src/sgml/ref/pgbench.sgml                |  81 ++++++++++++++---
src/bin/pgbench/exprparse.y                  |  17 ++++
src/bin/pgbench/pgbench.c                    | 131 +++++++++++++++++++++++++++
src/bin/pgbench/pgbench.h                    |   3 +-
src/bin/pgbench/t/001_pgbench_with_server.pl |  43 +++++++++
src/bin/pgbench/t/002_pgbench_no_server.pl   |  10 ++
6 files changed, 273 insertions(+), 12 deletions(-)



Message-ID: <E1lTjJs-0005R3-Bd@gemulon.postgresql.org>
Permalink:  ../E1lTjJs-0005R3-Bd@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lTjJs-0005R3-Bd@gemulon.postgresql.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: dean.a.rasheed@gmail.com
  Subject: Re: pgsql: pgbench: Function to generate random permutations.
  In-Reply-To: <E1lTjJs-0005R3-Bd@gemulon.postgresql.org>
  References: <E1lTjJs-0005R3-Bd@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox