Files
documentdb/pg_documentdb/sql/schema/composite_path_operator_class--0.103-0.sql
T
Vinod Sridharan 5ad889feeb Merged PR 1629302: [Composite POC] Fix up operators and type bracketing
### Does this PR have any customer impact?
Yes

### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Feature

### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?

### ChangeLog (Refer [Template](../oss/CHANGELOG.md))

### Description
1) Fix up the remaining operators - implementations are sub-optimal
2) Add type bracketing options for all types and use them in operators
3) Add support for truncation of terms

TODO:
- Support recheck on the index for operators than just bounds
- Support N boundaries for index terms.

----
#### AI description  (iteration 1)
#### PR Classification
Bug fix

#### PR Summary
This pull request addresses issues with operators and type bracketing in BSON composite indexes.
- Added `bson_gin_index_types_core.c` to manage BSON type bounds for indexes.
- Updated `bson_gin_composite_entrypoint.c` to fix operator handling and apply type bracketing for various BSON index strategies.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-04-10 10:29:08 -06:00

34 lines
3.5 KiB
SQL

CREATE OPERATOR CLASS __API_SCHEMA_INTERNAL_V2__.bson_rum_composite_path_ops
FOR TYPE __CORE_SCHEMA__.bson using __EXTENSION_OBJECT__(_rum) AS
OPERATOR 1 __API_CATALOG_SCHEMA__.@= (__CORE_SCHEMA__.bson, __CORE_SCHEMA__.bson),
OPERATOR 2 __API_CATALOG_SCHEMA__.@> (__CORE_SCHEMA__.bson, __CORE_SCHEMA__.bson),
OPERATOR 3 __API_CATALOG_SCHEMA__.@>= (__CORE_SCHEMA__.bson, __CORE_SCHEMA__.bson),
OPERATOR 4 __API_CATALOG_SCHEMA__.@< (__CORE_SCHEMA__.bson, __CORE_SCHEMA__.bson),
OPERATOR 5 __API_CATALOG_SCHEMA__.@<= (__CORE_SCHEMA__.bson, __CORE_SCHEMA__.bson),
OPERATOR 6 __API_CATALOG_SCHEMA__.@*= (__CORE_SCHEMA__.bson, __CORE_SCHEMA__.bson),
OPERATOR 7 __API_CATALOG_SCHEMA__.@!= (__CORE_SCHEMA__.bson, __CORE_SCHEMA__.bson),
OPERATOR 8 __API_CATALOG_SCHEMA__.@!*= (__CORE_SCHEMA__.bson, __CORE_SCHEMA__.bson),
OPERATOR 9 __API_CATALOG_SCHEMA__.@~ (__CORE_SCHEMA__.bson, __CORE_SCHEMA__.bson),
OPERATOR 10 __API_CATALOG_SCHEMA__.@? (__CORE_SCHEMA__.bson, __CORE_SCHEMA__.bson),
OPERATOR 11 __API_CATALOG_SCHEMA__.@@# (__CORE_SCHEMA__.bson, __CORE_SCHEMA__.bson),
OPERATOR 12 __API_CATALOG_SCHEMA__.@# (__CORE_SCHEMA__.bson, __CORE_SCHEMA__.bson),
OPERATOR 13 __API_CATALOG_SCHEMA__.@&= (__CORE_SCHEMA__.bson, __CORE_SCHEMA__.bson),
OPERATOR 14 __API_CATALOG_SCHEMA__.=?= (__CORE_SCHEMA__.bson, __CORE_SCHEMA__.bson),
OPERATOR 15 __API_CATALOG_SCHEMA__.@!& (__CORE_SCHEMA__.bson, __CORE_SCHEMA__.bson),
OPERATOR 16 __API_CATALOG_SCHEMA__.@!| (__CORE_SCHEMA__.bson, __CORE_SCHEMA__.bson),
OPERATOR 17 __API_CATALOG_SCHEMA__.@#? (__CORE_SCHEMA__.bson, __CORE_SCHEMA__.bson),
OPERATOR 18 __API_CATALOG_SCHEMA__.@& (__CORE_SCHEMA__.bson, __CORE_SCHEMA__.bson),
OPERATOR 19 __API_CATALOG_SCHEMA__.@| (__CORE_SCHEMA__.bson, __CORE_SCHEMA__.bson),
OPERATOR 20 __API_CATALOG_SCHEMA__.@% (__CORE_SCHEMA__.bson, __CORE_SCHEMA__.bson),
OPERATOR 25 __API_CATALOG_SCHEMA__.@<> (__CORE_SCHEMA__.bson, __CORE_SCHEMA__.bson),
OPERATOR 26 __API_SCHEMA_INTERNAL_V2__.@!> (__CORE_SCHEMA__.bson, __CORE_SCHEMA__.bson),
OPERATOR 27 __API_SCHEMA_INTERNAL_V2__.@!>= (__CORE_SCHEMA__.bson, __CORE_SCHEMA__.bson),
OPERATOR 28 __API_SCHEMA_INTERNAL_V2__.@!< (__CORE_SCHEMA__.bson, __CORE_SCHEMA__.bson),
OPERATOR 29 __API_SCHEMA_INTERNAL_V2__.@!<= (__CORE_SCHEMA__.bson, __CORE_SCHEMA__.bson),
FUNCTION 1 __API_CATALOG_SCHEMA__.gin_bson_compare(bytea, bytea),
FUNCTION 2 __API_SCHEMA_INTERNAL_V2__.gin_bson_composite_path_extract_value(__CORE_SCHEMA__.bson, internal),
FUNCTION 3 __API_SCHEMA_INTERNAL_V2__.gin_bson_composite_path_extract_query(__CORE_SCHEMA__.bson, internal, int2, internal, internal, internal, internal),
FUNCTION 4 __API_SCHEMA_INTERNAL_V2__.gin_bson_composite_path_consistent(internal, int2, anyelement, int4, internal, internal),
FUNCTION 5 __API_SCHEMA_INTERNAL_V2__.gin_bson_composite_path_compare_partial(bytea, bytea, int2, internal),
FUNCTION 11 (__CORE_SCHEMA__.bson) __API_SCHEMA_INTERNAL_V2__.gin_bson_composite_path_options(internal),
STORAGE bytea;