summaryrefslogtreecommitdiff
path: root/src/backend/access/brin/brin_validate.c
diff options
context:
space:
mode:
authorTomas Vondra2021-03-22 23:12:19 +0000
committerTomas Vondra2021-03-22 23:45:03 +0000
commita1c649d889bdf6e74e9382e1e28574d7071568de (patch)
treef915b9a0d6ff64d1c891967b268ae6237e19fd7f /src/backend/access/brin/brin_validate.c
parentbfa2cee784125047771db2768fcf7f04d8bd6bb4 (diff)
Pass all scan keys to BRIN consistent function at once
This commit changes how we pass scan keys to BRIN consistent function. Instead of passing them one by one, we now pass all scan keys for a given attribute at once. That makes the consistent function a bit more complex, as it has to loop through the keys, but it does allow more elaborate opclasses that can use multiple keys to eliminate ranges much more effectively. The existing BRIN opclasses (minmax, inclusion) don't really benefit from this change. The primary purpose is to allow future opclases to benefit from seeing all keys at once. This does change the BRIN API, because the signature of the consistent function changes (a new parameter with number of scan keys). So this breaks existing opclasses, and will require supporting two variants of the code for different PostgreSQL versions. We've considered supporting two variants of the consistent, but we've decided not to do that. Firstly, there's another patch that moves handling of NULL values from the opclass, which means the opclasses need to be updated anyway. Secondly, we're not aware of any out-of-core BRIN opclasses, so it does not seem worth the extra complexity. Bump catversion, because of pg_proc changes. Author: Tomas Vondra <[email protected]> Reviewed-by: Alvaro Herrera <[email protected]> Reviewed-by: Mark Dilger <[email protected]> Reviewed-by: Alexander Korotkov <[email protected]> Reviewed-by: John Naylor <[email protected]> Reviewed-by: Nikita Glukhov <[email protected]> Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/backend/access/brin/brin_validate.c')
-rw-r--r--src/backend/access/brin/brin_validate.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/access/brin/brin_validate.c b/src/backend/access/brin/brin_validate.c
index 6d4253c05e2..2c4f9a3eff2 100644
--- a/src/backend/access/brin/brin_validate.c
+++ b/src/backend/access/brin/brin_validate.c
@@ -97,8 +97,8 @@ brinvalidate(Oid opclassoid)
break;
case BRIN_PROCNUM_CONSISTENT:
ok = check_amproc_signature(procform->amproc, BOOLOID, true,
- 3, 3, INTERNALOID, INTERNALOID,
- INTERNALOID);
+ 4, 4, INTERNALOID, INTERNALOID,
+ INTERNALOID, INT4OID);
break;
case BRIN_PROCNUM_UNION:
ok = check_amproc_signature(procform->amproc, BOOLOID, true,