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/common | |
parent | 9583aea9d09f6b3839ede8e57f990262b24e6979 (diff) |
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/common')
-rw-r--r-- | src/backend/access/common/tupdesc.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/backend/access/common/tupdesc.c b/src/backend/access/common/tupdesc.c index 769f754b669..86d704e8d08 100644 --- a/src/backend/access/common/tupdesc.c +++ b/src/backend/access/common/tupdesc.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.73 2001/03/22 06:16:06 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.74 2001/05/07 00:43:15 tgl Exp $ * * NOTES * some of the executor utility code such as "ExecTypeFromTL" should be @@ -237,16 +237,16 @@ equalTupleDescs(TupleDesc tupdesc1, TupleDesc tupdesc2) Form_pg_attribute attr2 = tupdesc2->attrs[i]; /* - * We do not need to check every single field here, and in fact - * some fields such as attdispersion probably shouldn't be - * compared. We can also disregard attnum (it was used to place - * the row in the attrs array) and everything derived from the - * column datatype. + * We do not need to check every single field here: we can disregard + * attrelid, attnum (it was used to place the row in the attrs array) + * and everything derived from the column datatype. */ if (strcmp(NameStr(attr1->attname), NameStr(attr2->attname)) != 0) return false; if (attr1->atttypid != attr2->atttypid) return false; + if (attr1->attstattarget != attr2->attstattarget) + return false; if (attr1->atttypmod != attr2->atttypmod) return false; if (attr1->attstorage != attr2->attstorage) @@ -365,12 +365,12 @@ TupleDescInitEntry(TupleDesc desc, else MemSet(NameStr(att->attname), 0, NAMEDATALEN); - att->attdispersion = 0; /* dummy value */ + att->attstattarget = 0; att->attcacheoff = -1; att->atttypmod = typmod; att->attnum = attributeNumber; - att->attnelems = attdim; + att->attndims = attdim; att->attisset = attisset; att->attnotnull = false; @@ -506,7 +506,7 @@ TupleDescMakeSelfReference(TupleDesc desc, att->attbyval = true; att->attalign = 'i'; att->attstorage = 'p'; - att->attnelems = 0; + att->attndims = 0; } /* ---------------------------------------------------------------- |