Re: CPU costs of random_zipfian in pgbench

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Georgios Kokolatos <gkokolatos(at)pm(dot)me>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: CPU costs of random_zipfian in pgbench
Date: 2019-03-23 18:11:44
Message-ID: alpine.DEB.2.21.1903231910020.18811@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello again,

>> I started to look through this, and the more I looked the more unhappy
>> I got that we're having this discussion at all. The zipfian support
>> in pgbench is seriously over-engineered and under-documented. As an
>> example, I was flabbergasted to find out that the end-of-run summary
>> statistics now include this:
>>
>> /* Report zipfian cache overflow */
>> for (i = 0; i < nthreads; i++)
>> {
>> totalCacheOverflows += threads[i].zipf_cache.overflowCount;
>> }
>> if (totalCacheOverflows > 0)
>> {
>> printf("zipfian cache array overflowed %d time(s)\n",
>> totalCacheOverflows);
>> }
>>
>> What is the point of that, and if there is a point, why is it nowhere
>> mentioned in pgbench.sgml?

The attached patch simplifies the code by erroring on cache overflow,
instead of the LRU replacement strategy and unhelpful final report. The
above lines are removed.

--
Fabien.

Attachment Content-Type Size
pgbench-zipf-cache-simple-1.patch text/x-diff 3.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2019-03-23 18:45:33 Re: CPU costs of random_zipfian in pgbench
Previous Message Fabien COELHO 2019-03-23 17:44:35 Re: CPU costs of random_zipfian in pgbench