mirror of
https://github.com/postgres/postgres.git
synced 2025-08-21 10:42:50 +03:00
Allow opclasses to provide tri-valued GIN consistent functions.
With the GIN "fast scan" feature, GIN can skip items without fetching all the keys for them, if it can prove that they don't match regardless of those keys. So far, it has done the proving by calling the boolean consistent function with all combinations of TRUE/FALSE for the unfetched keys, but since that's O(n^2), it becomes unfeasible with more than a few keys. We can avoid calling consistent with all the combinations, if we can tell the operator class implementation directly which keys are unknown. This commit includes a triConsistent function for the built-in array and tsvector opclasses. Alexander Korotkov, with some changes by me.
This commit is contained in:
@@ -149,6 +149,7 @@ extern Datum gin_cmp_tslexeme(PG_FUNCTION_ARGS);
|
||||
extern Datum gin_cmp_prefix(PG_FUNCTION_ARGS);
|
||||
extern Datum gin_extract_tsquery(PG_FUNCTION_ARGS);
|
||||
extern Datum gin_tsquery_consistent(PG_FUNCTION_ARGS);
|
||||
extern Datum gin_tsquery_triconsistent(PG_FUNCTION_ARGS);
|
||||
extern Datum gin_extract_tsvector_2args(PG_FUNCTION_ARGS);
|
||||
extern Datum gin_extract_tsquery_5args(PG_FUNCTION_ARGS);
|
||||
extern Datum gin_tsquery_consistent_6args(PG_FUNCTION_ARGS);
|
||||
|
Reference in New Issue
Block a user