Commit ID 0e5e167aaea4ceb355a6e20eec96c4f7d05527ab
|
Contributor: | Tom Lane | Files Modified: | 24 |
| Date: | 04-March-2012 at 01:20 | Lines Added: | 2262 | |
| Repository: | git://git.postgresql.org/git/postgresql.git master | Lines Removed: | 152 | |
| Commit Comment: | Collect and use element-frequency statistics for arrays. This patch improves selectivity estimation for the array <@, &&, and @> (containment and overlaps) operators. It enables collection of statistics about individual array element values by ANALYZE, and introduces operator-specific estimators that use these stats. In addition, ScalarArrayOpExpr constructs of the forms "const = ANY/ALL (array_column)" and "const <> ANY/ALL (array_column)" are estimated by treating them as variants of the containment operators. Since we still collect scalar-style stats about the array values as a whole, the pg_stats view is expanded to show both these stats and the array-style stats in separate columns. This creates an incompatible change in how stats for tsvector columns are displayed in pg_stats: the stats about lexemes are now displayed in the array-related columns instead of the original scalar-related columns. There are a few loose ends here, notably that it'd be nice to be able to suppress either the scalar-style stats or the array-element stats for columns for which they're not useful. But the patch is in good enough shape to commit for wider testing. Alexander Korotkov, reviewed by Noah Misch and Nathan Boley |
|||
| File | Language | Code Added | Code Removed | Comments Added | Comment Removed | Blanks Added | Blanks Removed | |
|---|---|---|---|---|---|---|---|---|
| doc/src/sgml/catalogs.sgml | No source code was detected in this file. | |||||||
| src/backend/catalog/heap.c | C | 1 | 1 | 0 | 0 | 0 | 0 | |
| src/backend/catalog/system_views.sql | SQL | 34 | 9 | 0 | 0 | 0 | 0 | |
| src/backend/commands/analyze.c | C | 5 | 6 | 0 | 0 | 0 | 1 | |
| src/backend/commands/typecmds.c | C | 3 | 3 | 0 | 0 | 0 | 0 | |
| src/backend/tsearch/ts_selfuncs.c | C | 0 | 0 | 4 | 0 | 0 | 0 | |
| src/backend/tsearch/ts_typanalyze.c | C | 0 | 0 | 5 | 0 | 0 | 0 | |
| src/backend/utils/adt/array_selfuncs.c | C | 704 | 0 | 398 | 0 | 123 | 0 | |
| src/backend/utils/adt/array_typanalyze.c | C | 404 | 0 | 267 | 0 | 91 | 0 | |
| src/backend/utils/adt/Makefile | Make | 2 | 1 | 0 | 0 | 0 | 0 | |
Copyright
©
2013
Black Duck Software, Inc.
and its contributors, Some Rights Reserved. Unless otherwise marked, this work is licensed under a
Creative Commons Attribution 3.0 Unported License
. Ohloh
®
and the Ohloh logo are trademarks of
Black Duck Software, Inc.
in the United States and/or other jurisdictions. All other trademarks are the property of their respective holders.