Re: ALTER TABLE .. SET STATISTICS

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Ron <ronljohnsonjr(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: ALTER TABLE .. SET STATISTICS
Date: 2018-08-05 14:43:29
Message-ID: 20180805144329.kjctch4yb42j37i4@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2018-Aug-05, Ron wrote:

> For columns of type bytea which store image data (PDFs, JPGs, etc) would it
> speed up the ANALYZE process to SET STATISTICS = 0?

Yes. I'd suggest also looking at ALTER TABLE ... SET STORAGE to avoid
having Postgres try to compress those columns, which is useless waste of
CPU cycles, since those formats already compress.

> That way, default_statistics_target could be cranked higher -- giving better
> statistics for needed columns -- without polluting pg_statistics with
> unneeded data?

Right.

With the default being 100 I don't think there's a real need to crank it
higher server-wide, but it may be useful to crank it higher for specific
columns.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2018-08-05 15:43:53 Re: ALTER TABLE .. SET STATISTICS
Previous Message Andres Freund 2018-08-05 14:36:41 Re: Walsender waiting on SnapbuildSync