Re: WIP: BRIN multi-range indexes
Tomas Vondra <tomas.vondra@2ndquadrant.com>
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Alexander Korotkov <aekorotkov@gmail.com>
Cc: Masahiko Sawada <masahiko.sawada@2ndquadrant.com>, Alvaro Herrera <alvherre@2ndquadrant.com>, Michael Paquier <michael@paquier.xyz>, Tom Lane <tgl@sss.pgh.pa.us>, Andres Freund <andres@anarazel.de>, Mark Dilger <hornschnorter@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2020-08-04T15:17:43Z
Lists: pgsql-hackers
On Tue, Aug 04, 2020 at 05:36:51PM +0300, Alexander Korotkov wrote: >Hi, Tomas! > >Sorry for the late reply. > >On Sun, Jul 19, 2020 at 6:19 PM Tomas Vondra ><tomas.vondra@2ndquadrant.com> wrote: >> I think there's a number of weak points in this approach. >> >> Firstly, it assumes the summaries can be represented as arrays of >> built-in types, which I'm not really sure about. It clearly is not true >> for the bloom opclasses, for example. But even for minmax oclasses it's >> going to be tricky because the ranges may be on different data types so >> presumably we'd need somewhat nested data structure. >> >> Moreover, multi-minmax summary contains either points or intervals, >> which requires additional fields/flags to indicate that. That further >> complicates the things ... >> >> maybe we could decompose that into separate arrays or something, but >> honestly it seems somewhat premature - there are far more important >> aspects to discuss, I think (e.g. how the ranges are built/merged in >> multi-minmax, or whether bloom opclasses are useful at all). > >I see. But there is at least a second option to introduce a new >datatype with just an output function. In the similar way >gist/tsvector_ops uses gtsvector key type. I think it would be more >transparent than using just bytea. Also, this is the way we already >use in the core. > So you're proposing to have a new data types "brin_minmax_multi_summary" and "brin_bloom_summary" (or some other names), with output functions printing something nicer? I suppose that could work, and we could even add pageinspect functions returning the value as raw bytea. Good idea! >> >BTW, I've applied the patchset to the current master, but I got a lot >> >of duplicate oids. Could you please resolve these conflicts. I think >> >it would be good to use high oid numbers to evade conflicts during >> >development/review, and rely on committer to set final oids (as >> >discussed in [1]). >> > >> >Links >> >1. https://www.postgresql.org/message-id/CAH2-WzmMTGMcPuph4OvsO7Ykut0AOCF_i-%3DeaochT0dd2BN9CQ%40mail.gmail.com >> >> Did you use the patchset from 2020/07/03? I don't get any duplicate OIDs >> with it, and it's already using quite high OIDs (part 4 uses >= 8000, >> part 5 uses >= 9000). > >Yep, it appears that I was using the wrong version of patchset. >Patchset from 2020/07/03 works good on the current master. > OK, good. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
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