Re: BRIN indexes vs. SK_SEARCHARRAY (and preprocessing scan keys)
Tomas Vondra <tomas.vondra@enterprisedb.com>
From: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-02-17T02:50:54Z
Lists: pgsql-hackers
Attachments
- 0001-BRIN-bloom-cleanup-20230217.patch (text/x-patch) patch 0001
- 0002-BRIN-minmax-multi-cleanup-20230217.patch (text/x-patch) patch 0002
- 0003-Introduce-bloom_filter_size-20230217.patch (text/x-patch) patch 0003
- 0004-Add-minmax-multi-inequality-tests-20230217.patch (text/x-patch) patch 0004
- 0005-Introduce-BRIN_PROCNUM_PREPROCESS-procedure-20230217.patch (text/x-patch) patch 0005
- 0006-Support-SK_SEARCHARRAY-in-BRIN-minmax-20230217.patch (text/x-patch) patch 0006
- 0007-Support-SK_SEARCHARRAY-in-BRIN-minmax-multi-20230217.patch (text/x-patch) patch 0007
- 0008-Support-SK_SEARCHARRAY-in-BRIN-inclusion-20230217.patch (text/x-patch) patch 0008
- 0009-Support-SK_SEARCHARRAY-in-BRIN-bloom-20230217.patch (text/x-patch) patch 0009
cfbot identified a couple issues in the pathes: 1) not handling NULLs correctly (or rather at all). There was a FIXME, so I took this as a sign it's time to finally address that. 2) minmax-multi did not fully adopt the preprocessed values in the second part of the _consistent function The patches also add a bunch of regression tests to improve coverage. While adding those, I ran into an interesting behavior with BRIN bloom indexes. If you have such index on a bigint column, then this won't use the index: SELECT * FROM t WHERE b = 82; unless you cast the constant to bigint like this: SELECT * FROM t WHERE b = 82::bigint; I vaguely remember dealing with this while working on the bloom indexes, and concluding this is OK. But what's interesting is that with multiple values in the IN clause it works and this will use the index: SELECT * FROM t WHERE b IN (82, 83); That's a bit surprising. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Commits
-
Improve BRIN minmax-multi opclass test coverage
- 0457109344b4 17.0 landed
-
Introduce bloom_filter_size for BRIN bloom opclass
- 2b8b2852bbc5 17.0 landed
-
Minor cleanups in the BRIN code
- 28d03feac386 17.0 landed
-
Support GiST index support functions that want to cache data across calls.
- d22a09dc70f9 9.2.0 cited