Re: CPU costs of random_zipfian in pgbench

Fabien COELHO <coelho@cri.ensmp.fr>

From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Tomas Vondra <tomas.vondra@2ndquadrant.com>, Georgios Kokolatos <gkokolatos@pm.me>, PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2019-04-03T19:54:54Z
Lists: pgsql-hackers

Attachments

> Ah, so we now we can get rid of the TState * being passed around
> separately for expression execution, too?

Indeed.

I would have thought that the compiler would have warned if it is unused, 
but because of the recursion it is uselessly used.

Ok, maybe the sentence above is not very clear. Attached a patch which 
simplifies further.

-- 
Fabien.

Commits

  1. Remove now-unnecessary thread pointer arguments in pgbench.

  2. Restrict pgbench's zipfian parameter to ensure good performance.