Re: [PROPOSAL] Covering + unique indexes. - Mailing list pgsql-hackers

From Nicolas Barbier
Subject Re: [PROPOSAL] Covering + unique indexes.
Date
Msg-id CAP-rdTbiYt+sgWoNc10boJmwU7qmZto20Larzv3LZ4iB3Mv3MQ@mail.gmail.com
Whole thread Raw
In response to Re: [PROPOSAL] Covering + unique indexes.  (David Rowley <david.rowley@2ndquadrant.com>)
Responses Re: [PROPOSAL] Covering + unique indexes.  (David Rowley <david.rowley@2ndquadrant.com>)
List pgsql-hackers
2015-09-15 David Rowley <david.rowley@2ndquadrant.com>:

> I'm also a bit confused where f3 comes in here. If it's UNIQUE on (f1,f2)
> and we include f4. Where's f3?

Columns f1, f2, f3 are in the internal nodes of the tree (i.e., they
are used to find the ultimate leaf nodes). f4 is only in the leaf
nodes. If f4 are typically big values, and they are typically not used
in the search predicate, it makes the upper part of the index (which
determines how many levels the index has) larger for no good reason.
f4 can still be retrieved without going to the heap, so including it
in the leaf nodes makes it possible to do index-only scans more often.

Nicolas

-- 
A. Because it breaks the logical sequence of discussion.
Q. Why is top posting bad?



pgsql-hackers by date:

Previous
From: Vik Fearing
Date:
Subject: Re: [PROPOSAL] Covering + unique indexes.
Next
From: Sameer Thakur-2
Date:
Subject: Re: Support for N synchronous standby servers - take 2