Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 71b6617

Browse filesBrowse 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
Copy full SHA for 71b6617

File tree

Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed

‎src/backend/catalog/index.c

Copy file name to clipboardExpand all lines: src/backend/catalog/index.c
+5-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.