Content-Length: 264524 | pFad | http://github.com/postgrespro/postgres/commit/71b66171d045878cb9267a268a3bf8ce4f11f333

F4 CREATE INDEX: do not update stats during binary upgrade. · postgrespro/postgres@71b6617 · GitHub
Skip to content

Commit 71b6617

Browse files
committed
CREATE INDEX: do not update stats during binary upgrade.
During binary upgrade, indexes are created before the data is moved into place, so it will always be zero. This is not currently a major problem, but will be when we try to preserve statistics during upgrade. Author: Corey Huinker Discussion: https://postgr.es/m/CADkLM=daPdFB8V0tgFxK-dLowFsAEzWRWJHyxij7BG3kBjcouA@mail.gmail.com
1 parent 0628670 commit 71b6617

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/backend/catalog/index.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2874,7 +2874,11 @@ index_update_stats(Relation rel,
28742874
dirty = true;
28752875
}
28762876

2877-
if (reltuples >= 0)
2877+
/*
2878+
* Avoid updating statistics during binary upgrade, because the indexes
2879+
* are created before the data is moved into place.
2880+
*/
2881+
if (reltuples >= 0 && !IsBinaryUpgrade)
28782882
{
28792883
BlockNumber relpages = RelationGetNumberOfBlocks(rel);
28802884
BlockNumber relallvisible;

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/71b66171d045878cb9267a268a3bf8ce4f11f333

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy