Re: HyperLogLog.c and pg_leftmost_one_pos32() - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: HyperLogLog.c and pg_leftmost_one_pos32()
Date
Msg-id 20200730171619.3mtqgqg2z6lhmljo@development
Whole thread Raw
In response to Re: HyperLogLog.c and pg_leftmost_one_pos32()  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: HyperLogLog.c and pg_leftmost_one_pos32()
List pgsql-hackers
On Thu, Jul 30, 2020 at 09:21:23AM -0700, Jeff Davis wrote:
>On Wed, 2020-07-29 at 17:32 -0700, Peter Geoghegan wrote:
>> How did you test this? What kind of difference are we talking about?
>
>Essentially:
>  initHyperLogLog(&hll, 5)
>  for i in 0 .. one billion
>    addHyperLogLog(&hll, hash(i))
>  estimateHyperLogLog
>
>The numbers are the same regardless of bwidth.
>
>Before my patch, it takes about 15.6s. After my patch, it takes about
>6.6s, so it's more than a 2X speedup (including the hash calculation).
>

Wow. That's a huge improvements.

How does the whole test (data + query) look like? Is it particularly
rare / special case, or something reasonable to expect in practice?

regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: HyperLogLog.c and pg_leftmost_one_pos32()
Next
From: Bruce Momjian
Date:
Subject: Re: PG 13 release notes, first draft