Re: pgbench - allow to create partitioned tables - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: pgbench - allow to create partitioned tables
Date
Msg-id CANP8+jKU1Wp3tvO7guugzXXy5-JFoMQUWxwpdOcuTqrA_W0q1A@mail.gmail.com
Whole thread Raw
In response to pgbench - allow to create partitioned tables  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: pgbench - allow to create partitioned tables  (Fabien COELHO <coelho@cri.ensmp.fr>)
List pgsql-hackers
On Tue, 23 Jul 2019 at 19:26, Fabien COELHO <coelho@cri.ensmp.fr> wrote:

Hello devs,

While doing some performance tests and reviewing patches, I needed to
create partitioned tables. Given the current syntax this is time
consumming.

Good idea. I wonder why we didn't have it already.
 
The attached patch adds two options to create a partitioned "account"
table in pgbench.

It allows to answer quickly simple questions, eg "what is the overhead of
hash partitioning on a simple select on my laptop"? Answer:

  # N=0..?
  sh> pgench -i -s 1 --partition-number=$N --partition-type=hash

Given current naming of options, I would call this --partitions=number-of-partitions and --partition-method=hash
 
  # then run
  sh> pgench -S -M prepared -P 1 -T 10

  # and look at latency:
  # no parts = 0.071 ms
  #   1 hash = 0.071 ms (did someone optimize this case?!)
  #   2 hash ~ 0.126 ms (+ 0.055 ms)
  #  50 hash ~ 0.155 ms
  # 100 hash ~ 0.178 ms
  # 150 hash ~ 0.232 ms
  # 200 hash ~ 0.279 ms
  # overhead ~ (0.050 + [0.0005-0.0008] * nparts) ms

It is linear? 

--
Simon Riggs                http://www.2ndQuadrant.com/
PostgreSQL Solutions for the Enterprise

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: stress test for parallel workers
Next
From: Andrew Dunstan
Date:
Subject: pgbench tests vs Windows