Re: Faster distinct query? - Mailing list pgsql-general

From Tom Lane
Subject Re: Faster distinct query?
Date
Msg-id 2228441.1632343722@sss.pgh.pa.us
Whole thread Raw
In response to Re: Faster distinct query?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: Faster distinct query?  (Israel Brewster <ijbrewster@alaska.edu>)
Re: Faster distinct query?  (Michael Lewis <mlewis@entrata.com>)
List pgsql-general
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> There is no where clause so I'm doubtful there is much to be gained going
> down this path.  The Index-Only scan seems like an optimal way to obtain
> this data and the existing query already does that.

The "index-only" scan is reported to do 86m heap fetches along the
way to returning 812m rows, so the data is apparently pretty dirty.
It's possible that a preliminary VACUUM to get page-all-visible hint
bits set would be a net win.

            regards, tom lane



pgsql-general by date:

Previous
From: Israel Brewster
Date:
Subject: Re: Faster distinct query?
Next
From: Ryan Booz
Date:
Subject: Re: Faster distinct query?