Re: [HACKERS] RFC: Key normalization for nbtree

2017-07-10 Thread Peter Geoghegan
On Mon, Jul 10, 2017 at 4:08 PM, Greg Stark wrote: > One thing I would like to see is features like this added to the > opclasses (or opfamilies?) using standard PG functions that return > standard PG data types. So if each opclass had a function that took > the data type in question and returned

Re: [HACKERS] RFC: Key normalization for nbtree

2017-07-10 Thread Greg Stark
On 10 July 2017 at 19:40, Peter Geoghegan wrote: > Key normalization means creating a representation for internal page > items that we always just memcmp(), regardless of the details of the > underlying datatypes. One thing I would like to see is features like this added to the opclasses (or opfa

Re: [HACKERS] RFC: Key normalization for nbtree

2017-07-10 Thread Peter Geoghegan
On Mon, Jul 10, 2017 at 12:53 PM, Claudio Freire wrote: > I do have a patch that attacks suffix truncation, heap tid unification > and prefix compression all at once. That's great! I'll certainly be able to review it. > It's on a hiatus ATM, but, as you say, the implementations are highly > corr

Re: [HACKERS] RFC: Key normalization for nbtree

2017-07-10 Thread Peter Geoghegan
On Mon, Jul 10, 2017 at 1:23 PM, Alvaro Herrera wrote: > Claudio Freire wrote: > >> A missing optimization is that having tid unification allows VACUUM to >> implement a different strategy when it needs to clean up only a tiny >> fraction of the index. It can do the lookup by key-tid instead of >>

Re: [HACKERS] RFC: Key normalization for nbtree

2017-07-10 Thread Alvaro Herrera
Claudio Freire wrote: > A missing optimization is that having tid unification allows VACUUM to > implement a different strategy when it needs to clean up only a tiny > fraction of the index. It can do the lookup by key-tid instead of > scanning the whole index, which can be a win if the index is l

Re: [HACKERS] RFC: Key normalization for nbtree

2017-07-10 Thread Claudio Freire
On Mon, Jul 10, 2017 at 3:40 PM, Peter Geoghegan wrote: > It might appear excessive to talk about several different techniques > in one place, but that seemed like the best way to me, because there > are subtle dependencies. If most of the optimizations are pursued as a > project all at once (say,

[HACKERS] RFC: Key normalization for nbtree

2017-07-10 Thread Peter Geoghegan
I've created a new Wiki page that describes a scheme for normalizing internal page items within B-Tree indexes, and the many optimizations that this can enable: https://wiki.postgresql.org/wiki/Key_normalization Key normalization means creating a representation for internal page items that we alw