Re: VACUUM's ancillary tasks - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: VACUUM's ancillary tasks
Date
Msg-id CAEepm=1jASR6hz6ovUQHEXYuD9i4ssoq1nXsjtW6bgjxHuMB0w@mail.gmail.com
Whole thread Raw
In response to VACUUM's ancillary tasks  (Vik Fearing <vik@2ndquadrant.fr>)
Responses Re: VACUUM's ancillary tasks  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
<div dir="ltr">On Mon, Aug 29, 2016 at 1:26 PM, Vik Fearing <<a
href="mailto:vik@2ndquadrant.fr">vik@2ndquadrant.fr</a>>wrote:<br />> While doing this, I noticed that ALTER
TABLEshould also re-analyze the<br />> table for obvious reasons, so I have that one set<br />>
"changes_since_analyze"to the number of rows rewritten as well.<br /><br />I noticed that ATExecAlterColumnType does
this:<br/><br />    /*                                                                         <br />     * Drop any
pg_statisticentry for the column, since it's now wrong type   <br />     */                                            
                          <br />    RemoveStatistics(RelationGetRelid(rel), attnum);  <br /><br />What if there is no
rewrite,because the type is binary compatible (ATColumnChangeRequiresRewrite returns false)?  Then I think your patch
won'tattract an autovacuum daemon to ANALYZE the table and produce new statistics, because it won't
touch changes_since_analyze. I wonder if we should simply keep the stats if no rewrite is required.  Aren't the
statisticalproperties of binary-compatible types also compatible?  Alternatively, we should consider bumping
changes_since_analyzein this case too, if you're going to do it in the rewrite case.<br /><br />-- <br />Thomas
Munro<br/><a href="http://www.enterprisedb.com">http://www.enterprisedb.com</a></div> 

pgsql-hackers by date:

Previous
From: Enrique Meneses
Date:
Subject: Re: Allowing GIN array_ops to work on anyarray
Next
From: Robert Haas
Date:
Subject: Re: store narrow values in hash indexes?