pgsql: Improve GIN indexscan cost estimation.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improve GIN indexscan cost estimation.
Date: 2010-10-18 00:53:28
Message-ID: E1P7dyi-0003Rw-1R@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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.

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=48c7d9f6ff99714495b7d6d2ebc44fbbe992cc8f

Modified Files
--------------
src/backend/access/gin/ginbtree.c | 23 ++-
src/backend/access/gin/gindatapage.c | 11 +-
src/backend/access/gin/ginentrypage.c | 16 +-
src/backend/access/gin/ginfast.c | 4 +-
src/backend/access/gin/gininsert.c | 56 ++++--
src/backend/access/gin/ginutil.c | 85 ++++++++
src/backend/access/gin/ginvacuum.c | 26 ++-
src/backend/access/gin/ginxlog.c | 2 +-
src/backend/utils/adt/selfuncs.c | 344 ++++++++++++++++++++++++++++++++-
src/include/access/gin.h | 36 +++-
10 files changed, 561 insertions(+), 42 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2010-10-18 01:43:52 pgsql: Fix a passel of inappropriately-named global functions in GIN.
Previous Message Magnus Hagander 2010-10-17 14:41:34 pgsql: Fix msvc build for localized versions of Visual C++