1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Improve GIN indexscan cost estimation.

The better estimate requires more statistics than we previously stored:
in particular, counts of "entry" versus "data" pages within the index,
as well as knowledge of the number of distinct key values.  We collect
this information during initial index build and update it during VACUUM,
storing the info in new fields on the index metapage.  No initdb is
required because these fields will read as zeroes in a pre-existing
index, and the new gincostestimate code is coded to behave (reasonably)
sanely if they are zeroes.

Teodor Sigaev, reviewed by Jan Urbanski, Tom Lane, and Itagaki Takahiro.
This commit is contained in:
Tom Lane
2010-10-17 20:52:32 -04:00
parent cd0e825321
commit 48c7d9f6ff
10 changed files with 561 additions and 42 deletions

View File

@ -839,7 +839,7 @@ ginContinueSplit(ginIncompleteSplit *split)
stack.parent = NULL;
findParents(&btree, &stack, split->rootBlkno);
ginInsertValue(&btree, stack.parent);
ginInsertValue(&btree, stack.parent, NULL);
FreeFakeRelcacheEntry(reln);