Re: Statistics Import and Export
Corey Huinker <corey.huinker@gmail.com>
Commits
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Change pg_dump default for statistics export.
- 34eb2a80d5a3 18.0 landed
-
pg_dump: Adjust reltuples from 0 to -1 for dumps of older versions.
- 5d6eac80cdce 18.0 landed
-
vacuumdb: Don't skip empty relations in --missing-stats-only mode.
- 987910502420 18.0 cited
-
pg_dump: Fix query for gathering attribute stats on older versions.
- f0d0083f52f9 18.0 landed
-
Prevent redeclaration of typedef TocEntry.
- 8ec0aaeae094 18.0 cited
-
Remove unused function parameters in pg_backup_archiver.c.
- ff3a7f0b6860 18.0 landed
-
pg_dump: Retrieve attribute statistics in batches.
- 9c02e3a986da 18.0 landed
-
pg_dump: Reduce memory usage of dumps with statistics.
- 7d5c83b4e90c 18.0 landed
-
Skip second WriteToc() call for custom-format dumps without data.
- e3cc039a7d93 18.0 landed
-
Add relallfrozen to pg_dump statistics.
- 4694aedf63bf 18.0 landed
-
Matview statistics depend on matview data.
- a0a4601765b8 18.0 cited
-
Add pg_dump --with-{schema|data|statistics} options.
- bde2fb797aae 18.0 landed
-
Stats: use schemaname/relname instead of regclass.
- 650ab8aaf195 18.0 landed
-
CREATE INDEX: do update index stats if autovacuum=off.
- 29d6808edebb 18.0 landed
-
Don't convert to and from floats in pg_dump.
- 1852aea3f526 18.0 landed
-
CREATE INDEX: don't update table stats if autovacuum=off.
- d611f8b1587b 18.0 landed
-
Organize and deduplicate statistics import tests.
- 1d33de9d6837 18.0 landed
-
Address stats export review comments.
- f9f4b43b8dc0 18.0 landed
-
Address stats import review comments.
- 298944e8d802 18.0 landed
-
Add relallfrozen to pg_class
- 99f8f3fbbc8f 18.0 cited
-
Fix pg_strtof() to not crash on NULL endptr.
- ebe919e95336 13.21 landed
- d69c781084f5 17.5 landed
- c7303f01c574 15.13 landed
- 76fbb38ef69c 14.18 landed
- 5c64ece8aaf3 16.9 landed
- 00d61a08c5fa 18.0 landed
-
Use attnum to identify index columns in pg_restore_attribute_stats().
- 40e27d04b4f6 18.0 landed
-
pg_dump: prepare attribute stats query.
- 6ee3b91bad26 18.0 landed
-
Avoid unnecessary relation stats query in pg_dump.
- 8f427187db78 18.0 landed
-
Remove redundant pg_set_*_stats() variants.
- a5cbdeb98af9 18.0 landed
-
Do not use in-place updates for statistics import.
- f3dae2ae5856 18.0 landed
-
Fix confusion about data type of pg_class.relpages and relallvisible.
- 9de2cc455eb9 18.0 landed
-
Documentation fixups for dumping statistics.
- cb45dc3afb05 18.0 landed
-
Trial fix for old cross-version upgrades.
- ab84d0ff806d 18.0 landed
-
Transfer statistics during pg_upgrade.
- 1fd1bd871012 18.0 landed
-
Lock table in ShareUpdateExclusive when importing index stats.
- 9f12da78d953 18.0 landed
-
Use in-place updates for pg_restore_relation_stats().
- a43567483c61 18.0 landed
-
Improve error message for replication of generated columns.
- 8fcd80258bcf 18.0 cited
-
pg_dump: Add dumpSchema and dumpData derivative flags.
- 96a81c1be929 18.0 landed
-
Disallow modifying statistics on system columns.
- 869ee4f10eca 18.0 landed
-
Add missing CommandCounterIncrement() in stats import functions.
- f22e436bff77 18.0 landed
-
Add functions pg_restore_relation_stats(), pg_restore_attribute_stats().
- d32d1463995c 18.0 landed
-
Documentation fixup.
- 07d00692c8da 18.0 landed
-
Add functions pg_set_attribute_stats() and pg_clear_attribute_stats().
- ce207d2a7901 18.0 landed
-
Change pg_*_relation_stats() functions to return type to void.
- dbe6bd4343d8 18.0 landed
-
Disable autovacuum for tables in stats import tests.
- 779972e534c0 18.0 landed
-
Allow pg_set_relation_stats() to set relpages to -1.
- b391d882ff38 18.0 landed
-
Fixup for pg_set_relation_stats().
- 35a015a60045 18.0 landed
-
Create functions pg_set_relation_stats, pg_clear_relation_stats.
- e839c8ecc935 18.0 landed
-
Add memory/disk usage for Window aggregate nodes in EXPLAIN.
- 95d6e9af07d2 18.0 cited
-
Improve performance of dumpSequenceData().
- bd15b7db489d 18.0 cited
-
Add INJECTION_POINT_CACHED() to run injection points directly from cache
- a0a5869a8598 18.0 cited
-
Improve performance of binary_upgrade_set_pg_class_oids().
- 2329cad1b93f 18.0 cited
-
Improve assertion in mdwritev()
- f04d1c1db011 17.0 cited
-
CREATE INDEX: do not update stats during binary upgrade.
- 71b66171d045 17.0 landed
-
Redefine pg_class.reltuples to be -1 before the first VACUUM or ANALYZE.
- 3d351d916b20 14.0 cited
Attachments
- v37-0004-Expose-attribute-statistics-functions-for-use-in.patch (text/x-patch) patch v37-0004
- v37-0002-Add-working-input-function-for-pg_ndistinct.patch (text/x-patch) patch v37-0002
- v37-0003-Add-working-input-function-for-pg_dependencies.patch (text/x-patch) patch v37-0003
- v37-0005-Add-extended-statistics-support-functions.patch (text/x-patch) patch v37-0005
- v37-0001-Enable-dumping-of-table-index-stats-in-pg_dump.patch (text/x-patch) patch v37-0001
- v37-0007-split-out-print_processing_notice.patch (text/x-patch) patch v37-0007
- v37-0006-split-out-check_conn_options.patch (text/x-patch) patch v37-0006
- v37-0009-preserve-catalog-lists-across-staged-runs.patch (text/x-patch) patch v37-0009
- v37-0010-Add-issues_sql_unlike-opposite-of-issues_sql_lik.patch (text/x-patch) patch v37-0010
- v37-0011-Add-force-analyze-to-vacuumdb.patch (text/x-patch) patch v37-0011
- v37-0008-split-out-generate_catalog_list.patch (text/x-patch) patch v37-0008
> > > +1, I've been reviewing the vacuumdb portion and am planning to start a new > thread in the near future. IIUC the bulk of the vacuumdb changes are > relatively noncontroversial, we just haven't reached consensus on the user > interface. > > -- > nathan > Attached is the latest (and probably last) unified patchset before parts get spun off into their own threads. 0001 - This is the unified changes to pg_dump, pg_restore, pg_dumpall, and pg_upgrade. It incorporates most of what Jeff changed when he unified v36j, with typo fixes spotted by Bruce. There was interest in splitting STATISTICS DATA into RELATION STATISTICS DATA and ATTRIBUTE STATISTICS DATA. To do that, we'd need to create separate TOC entries, and that doesn't seem worth it to me. There was also interest in changing the prefix for STATISTICS DATA. However, the only special case for prefixes currently relies on an isData flag. Since there is no isStatistics flag, we would either have to create one, or do strcmps on te->description looking for "STATISTICS DATA". It's do-able, but I'm not sure it's worth it. 0002-0005 are for extended stats. 0002 - This makes the input function for pg_ndistinct functional. 0003 - This makes the input function for pg_dependencies functional. 0004 - Makes several static functions in attribute_stats.c public for use by extended stats. One of those is get_stat_attr_type(), which in the last patchset was modified to take an attribute name rather than attnum, thus saving a syscache lookup. However, extended stats identifies attributes by attnum not name, so that optimization had to be set aside, at least temporarily. 0005 - These implement the functions pg_set_extended_stats(), pg_clear_extended_stats(), and pg_restore_extended_stats() and behave like their relation/attribute equivalents. If we can get these committed and used by pg_dump, then we don't have to debate how to handle post-upgrade steps for users who happen to have extended stats vs the approximately 99.75% of users who do not have extended stats. 0006-0011 - These are the currently on-ice vacuumdb changes. 0006-0009 are "do no harm" reorganizations which add no functionality but make 0011 clearer. 0010 introduces a new test check to TAP. This group will be spun out into their own thread where we can focus on what if any changes happen to vacuumdb. Any changes to vacuumdb are dependent on 0001 being committed, and any changes to vacuumdb would likewise be informed by the commit status of 0002-0005. Work still to be done, in the near and less-near term: * Adding statistic import for extended statistics objects (i.e. CREATE STATISTICS) to pg_dump. Blocked by 0002-0005. * Implementing optional statistics import in postgres_fdw. Blocked by 0001.