Re: Sparse bit set data structure

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Adrien NAYRAT <adrien(dot)nayrat(at)anayrat(dot)info>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Julien Rouhaud <rjuju123(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Andrey Borodin <x4mmm(at)yandex-team(dot)ru>, Claudio Freire <klaussfreire(at)gmail(dot)com>
Subject: Re: Sparse bit set data structure
Date: 2019-04-08 23:38:11
Message-ID: 20190408233811.swe47ono6wa35qwq@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Uh, should this be applied?

---------------------------------------------------------------------------

On Thu, Mar 28, 2019 at 03:46:03PM +0100, Adrien NAYRAT wrote:
> Hello,
>
> According to the draw and simple8b_mode struct comment, it seems there is a
> typo:
>
> > * 20-bit integer 20-bit integer 20-bit integer
> > * 1101 00000000000000010010 01111010000100100000 00000000000000010100
> > * ^
> > * selector
> > *
> > * The selector 1101 is 13 in decimal. From the modes table below, we see
> > * that it means that the codeword encodes three 12-bit integers. In decimal,
> > * those integers are 18, 500000 and 20. Because we encode deltas rather than
> > * absolute values, the actual values that they represent are 18, 500018 and
> > * 500038.
> [...]
> > {20, 3}, /* mode 13: three 20-bit integers */
>
>
> The comment should be "the codeword encodes three *20-bit* integers" ?
>
> Patch attached.
>
> Regards,

> diff --git a/src/backend/lib/integerset.c b/src/backend/lib/integerset.c
> index 28b4a38609..9984fd55e8 100644
> --- a/src/backend/lib/integerset.c
> +++ b/src/backend/lib/integerset.c
> @@ -805,7 +805,7 @@ intset_binsrch_leaf(uint64 item, leaf_item *arr, int arr_elems, bool nextkey)
> * selector
> *
> * The selector 1101 is 13 in decimal. From the modes table below, we see
> - * that it means that the codeword encodes three 12-bit integers. In decimal,
> + * that it means that the codeword encodes three 20-bit integers. In decimal,
> * those integers are 18, 500000 and 20. Because we encode deltas rather than
> * absolute values, the actual values that they represent are 18, 500018 and
> * 500038.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ As you are, so once was I. As I am, so you will be. +
+ Ancient Roman grave inscription +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Euler Taveira 2019-04-08 23:44:41 Re: change password_encryption default to scram-sha-256?
Previous Message Euler Taveira 2019-04-08 23:19:12 Re: Fix doc bug in logical replication.