Re: WIP: BRIN multi-range indexes
Zhihong Yu <zyu@yugabyte.com>
From: Zhihong Yu <zyu@yugabyte.com>
To: Tomas Vondra <tomas.vondra@enterprisedb.com>
Cc: John Naylor <john.naylor@enterprisedb.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-02-04T01:35:34Z
Lists: pgsql-hackers
Hi, bq. Not sure why would that be an issue Moving the (start > end) check is up to your discretion. But the midpoint computation should follow text book :-) Cheers On Wed, Feb 3, 2021 at 4:59 PM Tomas Vondra <tomas.vondra@enterprisedb.com> wrote: > > > On 2/4/21 1:49 AM, Zhihong Yu wrote: > > Hi, > > For 0007-Remove-the-special-batch-mode-use-a-larger--20210203.patch : > > > > + /* same as preceding value, so store it */ > > + if (compare_values(&range->values[start + i - 1], > > + &range->values[start + i], > > + (void *) &cxt) == 0) > > + continue; > > + > > + range->values[start + n] = range->values[start + i]; > > > > It seems the comment doesn't match the code: the value is stored when > > subsequent value is different from the previous. > > > > Yeah, you're right the comment is wrong - the code is doing exactly the > opposite. I'll need to go through this more carefully. > > > For has_matching_range(): > > + int midpoint = (start + end) / 2; > > > > I think the standard notion for midpoint is start + (end-start)/2. > > > > + /* this means we ran out of ranges in the last step */ > > + if (start > end) > > + return false; > > > > It seems the above should be ahead of computation of midpoint. > > > > Not sure why would that be an issue, as we're not using the value and > the values are just plain integers (so no overflows ...). > > > regards > > -- > Tomas Vondra > EnterpriseDB: http://www.enterprisedb.com > The Enterprise PostgreSQL Company >
Commits
-
BRIN minmax-multi indexes
- ab596105b55f 14.0 landed
-
BRIN bloom indexes
- 77b88cd1bb90 14.0 landed
-
Support the old signature of BRIN consistent function
- a681e3c107aa 14.0 landed
-
Remove unnecessary pg_amproc BRIN minmax entries
- a68dfa27d42f 14.0 landed
-
Optimize allocations in bringetbitmap
- 8e4b332e88b8 14.0 landed
-
Move IS [NOT] NULL handling from BRIN support functions
- 72ccf55cb99c 14.0 landed
-
Pass all scan keys to BRIN consistent function at once
- a1c649d889bd 14.0 landed
-
Properly detoast data in brin_form_tuple
- d2d3a4bd33d2 9.5.24 landed
- bae31e75f777 9.6.20 landed
- 0b96fc977c5b 10.15 landed
- 895d0f0e8218 11.10 landed
- 8149e9f9a0d6 12.5 landed
- 6a7b55f3716f 13.1 landed
- 7577dd84807a 14.0 landed