Re: [HACKERS] [WIP] Effective storage of duplicates in B-tree index.
Peter Geoghegan <pg@bowt.ie>
Attachments
- v23-0002-DEBUG-Add-pageinspect-instrumentation.patch (application/octet-stream) patch v23-0002
- v23-0001-Add-deduplication-to-nbtree.patch (application/octet-stream) patch v23-0001
On Fri, Nov 8, 2019 at 10:35 AM Peter Geoghegan <pg@bowt.ie> wrote: > There is more bitrot, so I attach v22. The patch has stopped applying once again, so I attach v23. One reason for the bitrot is that I pushed preparatory commits, including today's "Make _bt_keep_natts_fast() use datum_image_eq()" commit. Good to get that out of the way. Other changes: * Decided to go back to turning deduplication on by default with non-unique indexes, and off by default using unique indexes. The unique index stuff was regressed enough with INSERT-heavy workloads that I was put off, despite my initial enthusiasm for enabling deduplication everywhere. * Disabled deduplication in system catalog indexes by deeming it generally unsafe. I realized that it would be impossible to provide a way to disable deduplication in system catalog indexes if it was enabled at all. The reason for this is simple: in general, it's not possible to set storage parameters for system catalog indexes. While I think that deduplication should work with system catalog indexes on general principle, this is about an existing limitation. Deduplication in catalog indexes can be revisited if and when somebody figures out a way to make storage parameters work with system catalog indexes. * Basic user documentation -- this still needs work, but the basic shape is now in place. I think that we should outline how the feature works by describing the internals, including details of the data structures. This provides guidance to users on when they should disable or enable the feature. This is discussed in the existing chapter on B-Tree internals. This felt natural because it's similar to how GIN explains its compression related features -- the discussion of the storage parameters in the CREATE INDEX page of the docs links to a description of GIN internals from "66.4. Implementation [of GIN]". * nbtdedup.c "single value" strategy stuff now considers the contribution of the page high key when considering how to deduplicate such that nbtsplitloc.c's "single value" strategy has a usable split point that helps it to hit its target free space. Not a very important detail. It's nice to be consistent with the corresponding code within nbtsplitloc.c. * Worked through all remaining XXX/TODO/FIXME comments, except one: The one that talks about the need for opclass infrastructure to deal with cases like btree/numeric_ops, or text with a nondeterministic collation. The user docs now reference the BITWISE opclass stuff that we're discussing over on the other thread. That's the only really notable open item now IMV. -- Peter Geoghegan
Commits
-
Teach pageinspect about nbtree deduplication.
- 93ee38eade1b 13.0 landed
-
Doc: Fix deduplicate_items index term.
- e537aed61db7 13.0 landed
-
Revise BTP_HAS_GARBAGE nbtree VACUUM comments.
- 4b25f5d0ba01 13.0 cited
-
Remove unneeded "pin scan" nbtree VACUUM code.
- 9f83468b3536 13.0 landed
-
Cleanup code in reloptions.h regarding reloption handling
- 50d22de9325f 13.0 cited
-
Catch invalid typlens in a couple of places
- 8557a6f10ca6 13.0 cited
-
Compute XID horizon for page level index vacuum on primary.
- 558a9165e081 12.0 cited
-
Make heap TID a tiebreaker nbtree index column.
- dd299df8189b 12.0 cited
-
Avoid pin scan for replay of XLOG_BTREE_VACUUM in all cases
- 3e4b7d87988f 9.6.0 cited
-
Revert buggy optimization of index scans
- c7111d11b188 9.6.0 cited
-
Restructure index access method API to hide most of it at the C level.
- 65c5fcd353a8 9.6.0 cited
-
Reduce pinning and buffer content locking for btree scans.
- 2ed5b87f96d4 9.5.0 cited
-
Avoid scanning nulls at the beginning of a btree index scan.
- 1a77f8b63d15 9.2.0 cited