HyperLogLog.c and pg_leftmost_one_pos32()

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Robert Haas <rhaas(at)postgresql(dot)org>
Subject: HyperLogLog.c and pg_leftmost_one_pos32()
Date: 2020-07-29 17:07:51
Message-ID: 17068336d300fab76dd6131cbe1996df450dde38.camel@j-davis.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Is there a reason that HyperLogLog doesn't use pg_leftmost_one_pos32()?

I tried the following patch and some brief performance tests seem to
show an improvement.

This came up because my recent commit 9878b643 uses HLL for estimating
the cardinality of spill files, which solves a few annoyances with
overpartitioning[1]. I think it's overall an improvement, but
addHyperLogLog() itself seemed to show up as a cost, so it can hurt
spilled-but-still-in-memory cases. I'd also like to backpatch this to
13 (as I already did for 9878b643), if that's acceptable.

Regards,
Jeff Davis

[1]
https://www.postgresql.org/message-id/CAH2-Wznidojad-zbObnFOzDA5RTCS0JLsqcZkDNu+ou1NGYQYQ@mail.gmail.com

Attachment Content-Type Size
hll-bitutils.patch text/x-patch 701 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2020-07-29 17:13:23 Re: Default setting for enable_hashagg_disk
Previous Message Julien Rouhaud 2020-07-29 16:35:41 Re: IDEA: pg_stat_statements tracking utility statements by tag?