diff options
| author | Tom Lane | 2001-05-07 00:43:27 +0000 |
|---|---|---|
| committer | Tom Lane | 2001-05-07 00:43:27 +0000 |
| commit | f905d65ee35b3f84b6d4433a5198af0e2e7bd090 (patch) | |
| tree | 68f5955bb1a7ecaa531cf6b3752f563943dbe079 /src/test | |
| 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/test')
| -rw-r--r-- | src/test/regress/expected/oidjoins.out | 26 | ||||
| -rw-r--r-- | src/test/regress/expected/opr_sanity.out | 4 | ||||
| -rw-r--r-- | src/test/regress/sql/oidjoins.sql | 14 |
3 files changed, 34 insertions, 10 deletions
diff --git a/src/test/regress/expected/oidjoins.out b/src/test/regress/expected/oidjoins.out index a2b0ad9e3e..46bc60f695 100644 --- a/src/test/regress/expected/oidjoins.out +++ b/src/test/regress/expected/oidjoins.out @@ -353,12 +353,28 @@ WHERE pg_statistic.starelid != 0 AND -----+---------- (0 rows) -SELECT oid, pg_statistic.staop +SELECT oid, pg_statistic.staop1 FROM pg_statistic -WHERE pg_statistic.staop != 0 AND - NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_statistic.staop); - oid | staop ------+------- +WHERE pg_statistic.staop1 != 0 AND + NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_statistic.staop1); + oid | staop1 +-----+-------- +(0 rows) + +SELECT oid, pg_statistic.staop2 +FROM pg_statistic +WHERE pg_statistic.staop2 != 0 AND + NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_statistic.staop2); + oid | staop2 +-----+-------- +(0 rows) + +SELECT oid, pg_statistic.staop3 +FROM pg_statistic +WHERE pg_statistic.staop3 != 0 AND + NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_statistic.staop3); + oid | staop3 +-----+-------- (0 rows) SELECT oid, pg_trigger.tgrelid diff --git a/src/test/regress/expected/opr_sanity.out b/src/test/regress/expected/opr_sanity.out index 9d4ff1b398..1b094a6e3b 100644 --- a/src/test/regress/expected/opr_sanity.out +++ b/src/test/regress/expected/opr_sanity.out @@ -482,8 +482,8 @@ WHERE p1.aggtransfn = p2.oid AND (p2.pronargs = 1 AND p1.aggbasetype = 0))); oid | aggname | oid | proname -------+---------+-----+------------- - 16997 | max | 768 | int4larger - 17011 | min | 769 | int4smaller + 17010 | max | 768 | int4larger + 17024 | min | 769 | int4smaller (2 rows) -- Cross-check finalfn (if present) against its entry in pg_proc. diff --git a/src/test/regress/sql/oidjoins.sql b/src/test/regress/sql/oidjoins.sql index b7ea1f63ea..88727a6c76 100644 --- a/src/test/regress/sql/oidjoins.sql +++ b/src/test/regress/sql/oidjoins.sql @@ -177,10 +177,18 @@ SELECT oid, pg_statistic.starelid FROM pg_statistic WHERE pg_statistic.starelid != 0 AND NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_statistic.starelid); -SELECT oid, pg_statistic.staop +SELECT oid, pg_statistic.staop1 FROM pg_statistic -WHERE pg_statistic.staop != 0 AND - NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_statistic.staop); +WHERE pg_statistic.staop1 != 0 AND + NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_statistic.staop1); +SELECT oid, pg_statistic.staop2 +FROM pg_statistic +WHERE pg_statistic.staop2 != 0 AND + NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_statistic.staop2); +SELECT oid, pg_statistic.staop3 +FROM pg_statistic +WHERE pg_statistic.staop3 != 0 AND + NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_statistic.staop3); SELECT oid, pg_trigger.tgrelid FROM pg_trigger WHERE pg_trigger.tgrelid != 0 AND |
