diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-05-07 00:43:27 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-05-07 00:43:27 +0000 |
commit | f905d65ee35b3f84b6d4433a5198af0e2e7bd090 (patch) | |
tree | 68f5955bb1a7ecaa531cf6b3752f563943dbe079 /src/backend/access/gist/gist.c | |
parent | 9583aea9d09f6b3839ede8e57f990262b24e6979 (diff) | |
download | postgresql-f905d65ee35b3f84b6d4433a5198af0e2e7bd090.tar.gz postgresql-f905d65ee35b3f84b6d4433a5198af0e2e7bd090.zip |
Rewrite of planner statistics-gathering code. ANALYZE is now available as
a separate statement (though it can still be invoked as part of VACUUM, too).
pg_statistic redesigned to be more flexible about what statistics are
stored. ANALYZE now collects a list of several of the most common values,
not just one, plus a histogram (not just the min and max values). Random
sampling is used to make the process reasonably fast even on very large
tables. The number of values and histogram bins collected is now
user-settable via an ALTER TABLE command.
There is more still to do; the new stats are not being used everywhere
they could be in the planner. But the remaining changes for this project
should be localized, and the behavior is already better than before.
A not-very-related change is that sorting now makes use of btree comparison
routines if it can find one, rather than invoking '<' twice.
Diffstat (limited to 'src/backend/access/gist/gist.c')
-rw-r--r-- | src/backend/access/gist/gist.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c index 1c5577b88a0..06010896821 100644 --- a/src/backend/access/gist/gist.c +++ b/src/backend/access/gist/gist.c @@ -6,7 +6,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.72 2001/03/22 03:59:12 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.73 2001/05/07 00:43:15 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -84,8 +84,8 @@ static void gist_dumptree(Relation r, int level, BlockNumber blk, OffsetNumber c #endif /* -** routine to build an index. Basically calls insert over and over -*/ + * routine to build an index. Basically calls insert over and over + */ Datum gistbuild(PG_FUNCTION_ARGS) { @@ -105,7 +105,7 @@ gistbuild(PG_FUNCTION_ARGS) itupdesc; Datum attdata[INDEX_MAX_KEYS]; char nulls[INDEX_MAX_KEYS]; - int nhtups, + double nhtups, nitups; Node *pred = indexInfo->ii_Predicate; @@ -172,7 +172,7 @@ gistbuild(PG_FUNCTION_ARGS) #endif /* OMIT_PARTIAL_INDEX */ /* build the index */ - nhtups = nitups = 0; + nhtups = nitups = 0.0; compvec = (bool *) palloc(sizeof(bool) * indexInfo->ii_NumIndexAttrs); @@ -183,7 +183,7 @@ gistbuild(PG_FUNCTION_ARGS) { MemoryContextReset(econtext->ecxt_per_tuple_memory); - nhtups++; + nhtups += 1.0; #ifndef OMIT_PARTIAL_INDEX @@ -196,7 +196,7 @@ gistbuild(PG_FUNCTION_ARGS) slot->val = htup; if (ExecQual((List *) oldPred, econtext, false)) { - nitups++; + nitups += 1.0; continue; } } @@ -213,7 +213,7 @@ gistbuild(PG_FUNCTION_ARGS) } #endif /* OMIT_PARTIAL_INDEX */ - nitups++; + nitups += 1.0; /* * For the current heap tuple, extract all the attributes we use |