• Tom Lane's avatar
    Improve GIN indexscan cost estimation. · 48c7d9f6
    Tom Lane authored
    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.
    48c7d9f6
gindatapage.c 16.4 KB