Re: integrate pg_upgrade analyze_new_cluster.sh into vacuumdb - Mailing list pgsql-hackers

From Oskari Saarenmaa
Subject Re: integrate pg_upgrade analyze_new_cluster.sh into vacuumdb
Date
Msg-id 52DEA928.9000203@ohmu.fi
Whole thread Raw
In response to integrate pg_upgrade analyze_new_cluster.sh into vacuumdb  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: integrate pg_upgrade analyze_new_cluster.sh into vacuumdb
List pgsql-hackers
09.01.2014 05:15, Peter Eisentraut kirjoitti:
> pg_upgrade creates a script analyze_new_cluster.{sh|bat} that runs
> vacuumdb --analyze-only in three stages with different statistics target
> settings to get a fresh cluster analyzed faster.  I think this behavior
> is also useful for clusters or databases freshly created by pg_restore
> or any other loading mechanism, so it's suboptimal to have this
> constrained to pg_upgrade.

I think the three stage analyze is a wrong solution to the "slow 
analyze" problem.  In my experience most of the analyze time goes to 
reading random blocks from the disk but we usually use only a small 
portion of that data (1 row per block.)

If we were able to better utilize the data we read we could get good 
statistics with a lot less IO than we currently need.  This was 
discussed in length at
http://www.postgresql.org/message-id/CAM-w4HOjRbNPMW=SHjHw_Qfapcuu5Ege1tMdR0ZQU+kqX8Qeug@mail.gmail.com 
but it hasn't turned into patches so far.

/ Oskari




pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Closing commitfest 2013-11
Next
From: Fujii Masao
Date:
Subject: Re: [9.3 bug] disk space in pg_xlog increases during archive recovery