Re: WIP: BRIN multi-range indexes
Tomas Vondra <tomas.vondra@2ndquadrant.com>
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: John Naylor <john.naylor@2ndquadrant.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2020-09-11T18:05:10Z
Lists: pgsql-hackers
Attachments
On Fri, Sep 11, 2020 at 10:08:15AM -0400, John Naylor wrote: >On Fri, Sep 11, 2020 at 6:14 AM Tomas Vondra ><tomas.vondra@2ndquadrant.com> wrote: > >> I understand. I just feel a bit uneasy about replacing an index with >> something that may or may not be better for a certain use case. I mean, >> if you have data set for which regular minmax works fine, wouldn't you >> be annoyed if we just switched it for something slower? > >How about making multi minmax the default for new indexes, and those >who know their data will stay very well correlated can specify simple >minmax ops for speed? Upgraded indexes would stay the same, and only >new ones would have the risk of slowdown if not attended to. > That might work, I think. I like that it's an explicit choice, i.e. we may change what the default opclass is, but the behavior won't change unexpectedly during REINDEX etc. It might still be a bit surprising after dump/restore, but that's probably fine. It would be ideal if the opclasses were binary compatible, allowing a more seamless transition. Unfortunately that seems impossible, because plain minmax uses two Datums to store the range, while multi-minmax uses a more complex structure. >Also, I wonder if the slowdown in building a new index is similar to >the slowdown for updates. I'd like to run some TCP-H tests (that will >take some time). > It might be, because it needs to deserialize/serialize the summary too, and there's no option to amortize the costs over many inserts. OTOH the insert probably needs to do various other things, so maybe it's won't be that bad. But yeah, testing and benchmarking it would be nice. Do you plan to test just the minmax-multi opclass, or will you look at the bloom one too? Attached is a slightly improved version - I've merged the various pieces into the "main" patches, and made some minor additional optimizations. I've left the cost tweak as a separate part for now, though. 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