Thread: can postgres btree indexes shrink?
Does the postgres implementation of btrees shrink the index if adjacent index tree nodes can be combined?
I have read that data pages are not coalesced, only garbage collected when they become empty. But I have not seen anything specific about the treatment of index pages as deletions make the tree more sparse.
Thanks.
Azad
Azad Bolour wrote: > Does the postgres implementation of btrees shrink the index if adjacent > index tree nodes can be combined? No. Completely empty pages are collected as free space for later use, but partially-empty pages are not merged. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
Azad
On Wed, Jun 26, 2013 at 10:55 AM, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
Azad Bolour wrote:No. Completely empty pages are collected as free space for later use,
> Does the postgres implementation of btrees shrink the index if adjacent
> index tree nodes can be combined?
but partially-empty pages are not merged.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services