Re: Optimizing away second VACUUM heap scan when only BRIN indexes on table

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, Peter Geoghegan <pg(at)heroku(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Optimizing away second VACUUM heap scan when only BRIN indexes on table
Date: 2015-12-21 09:24:40
Message-ID: CANP8+jK3pPm1-U_Qgfjv8Z2JGzbd6tgaLC6pEG1kLo9Ok_TpRA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 21 December 2015 at 02:14, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
wrote:

> Jim Nasby wrote:
> > On 11/23/15 5:06 PM, Peter Geoghegan wrote:
> > >I realize that the second scan performed by lazy_vacuum_heap() only
> > >visits those pages known to contain dead tuples. However, the
> > >experience of seeing problems with the random sampling of ANALYZE
> > >makes me think that that might not be very helpful. There is no good
> > >reason to think that there won't be a uniform distribution of dead
> > >tuples across the heap, and so only visiting pages known to contain
> > >dead tuples might be surprisingly little help even when there are
> > >relatively few VACUUM-able tuples in the table.
> >
> > Even worse is if you can't fit all the dead TIDs in memory and have to do
> > multiple passes for no reason...
>
> Since BRIN indexes cannot be primary keys nor unique keys, it's hard to
> be convinced that the use case of a table with only BRIN indexes is
> terribly interesting.
>

Given BRIN's characteristics, such a table design is compelling when the
table is very large, yet possible only for certain use cases.

--
Simon Riggs http://www.2ndQuadrant.com/
<http://www.2ndquadrant.com/>
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2015-12-21 09:35:14 Re: Optimizing away second VACUUM heap scan when only BRIN indexes on table
Previous Message David Rowley 2015-12-21 09:02:29 Re: Combining Aggregates