forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit46dddf7
committed
Improve key representation for GIN jsonb_ops, and fix existence-search bug.
Change the key representation so that values that would exceed 127 bytesare hashed into short strings, and so that the original JSON datatype ofeach value is recorded in the index. The hashing rule eliminates the majorobjection to having this opclass be the default for jsonb, namely that itcould fail for plausible input data (due to GIN's restrictions on maximumkey length). Preserving datatype information doesn't really buy us muchright now, but it requires no extra space compared to the previous way,and it might be useful later.Also, change the consistency-checking functions to request recheck forexists (jsonb ? text) and related operators. The original analysis thatthis is an exactly checkable query was incorrect, since the index doesnot preserve information about whether a key appears at top level inthe indexed JSON object. Add a test case demonstrating the problem.Make some other, mostly cosmetic improvements to the code in jsonb_gin.cas well.catversion bump due to on-disk data format change in jsonb_ops indexes.1 parentff7bbb0 commit46dddf7
File tree
7 files changed
+299
-277
lines changed- src
- backend/utils/adt
- include
- catalog
- utils
- test/regress
- data
- expected
- sql
7 files changed
+299
-277
lines changed0 commit comments
Comments
(0)