pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
can postgres btree indexes shrink?
3+ messages / 2 participants
[nested] [flat]

* can postgres btree indexes shrink?
@ 2013-06-26 16:22  Azad Bolour <azadbolour@bolour.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Azad Bolour @ 2013-06-26 16:22 UTC (permalink / raw)
  To: pgsql-admin

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

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: can postgres btree indexes shrink?
@ 2013-06-26 17:55  Alvaro Herrera <alvherre@2ndquadrant.com>
  parent: Azad Bolour <azadbolour@bolour.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Alvaro Herrera @ 2013-06-26 17:55 UTC (permalink / raw)
  To: Azad Bolour <azadbolour@bolour.com>; +Cc: pgsql-admin

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


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: can postgres btree indexes shrink?
@ 2013-06-26 18:15  Azad Bolour <azadbolour@bolour.com>
  parent: Alvaro Herrera <alvherre@2ndquadrant.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Azad Bolour @ 2013-06-26 18:15 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: pgsql-admin

Thanks so much for the clarification.

Azad


On Wed, Jun 26, 2013 at 10:55 AM, Alvaro Herrera
<alvherre@2ndquadrant.com>wrote:

> 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
>

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2013-06-26 18:15 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-06-26 16:22 can postgres btree indexes shrink? Azad Bolour <azadbolour@bolour.com>
2013-06-26 17:55 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2013-06-26 18:15   ` Azad Bolour <azadbolour@bolour.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox