Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: cf/5517~1
Choose a base ref
...
head repository: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: cf/5517
Choose a head ref
  • 6 commits
  • 17 files changed
  • 3 contributors

Commits on Aug 1, 2025

  1. Refactor output format of pg_ndistinct and add working input function.

    The existing format of pg_ndistinct uses a single-object JSON structure
    where each key is itself a comma-separated list of attnums. While this
    is a very compact format, it's confusing to read and is difficult to
    manipulate values within the object. This wasn't a concern until
    statistics import functions were introduced, enabling users to inject
    hypothetical statistics into an object to observe their effect on the
    query planner.
    
    The new format is an array of objects, each object must have the keys
    "attributes", which must contain an array of attnums, and "ndistinct",
    which must be an integer. This is a quirk because the underlying
    internal storage is a double, but the value stored was always an
    integer.
    
    The change in format is adequately described from the changes to
    src/test/regress/expected/stats_ext.out so description here is
    redundant.
    coreyhuinker authored and Commitfest Bot committed Aug 1, 2025
    Configuration menu
    Copy the full SHA
    6e5f490 View commit details
    Browse the repository at this point in the history
  2. Refactor output format of pg_dependencies and add working input funct…

    …ion.
    
    The existing format of pg_dependencies uses a single-object JSON structure
    where each key is itself a comma-separated list of attnums. While this
    is a very compact format, it's confusing to read and is difficult to
    manipulate values within the object. This wasn't a concern until
    statistics import functions were introduced, enabling users to inject
    hypothetical statistics into an object to observe their effect on the
    query planner.
    
    The new format is an array of objects, each object must have the keys
    "attributes", which must contain an array of attnums, "dependency",
    which must be an integer, and "degree", which must be a float.
    
    The change in format is adequately described from the changes to
    src/test/regress/expected/stats_ext.out so description here is
    redundant.
    coreyhuinker authored and Commitfest Bot committed Aug 1, 2025
    Configuration menu
    Copy the full SHA
    cffd1b4 View commit details
    Browse the repository at this point in the history
  3. Expose attribute statistics functions for use in extended_stats.

    Many of the operations of attribute stats have analogous operations in
    extended stats.
    
    * get_attr_stat_type()
    * init_empty_stats_tuple()
    * text_to_stavalues()
    * get_elem_stat_type()
    Corey Huinker authored and Commitfest Bot committed Aug 1, 2025
    Configuration menu
    Copy the full SHA
    c0ba4bf View commit details
    Browse the repository at this point in the history
  4. Add extended statistics support functions.

    Add pg_restore_extended_stats() and pg_clear_extended_stats(). These
    functions closely mirror their relation and attribute counterparts,
    but for extended statistics (i.e.  CREATE STATISTICS) objects.
    coreyhuinker authored and Commitfest Bot committed Aug 1, 2025
    Configuration menu
    Copy the full SHA
    907077c View commit details
    Browse the repository at this point in the history
  5. Include Extended Statistics in pg_dump.

    Incorporate the new pg_restore_extended_stats() function into pg_dump.
    This detects the existence of extended statistics statistics (i.e.
    pg_statistic_ext_data rows).
    
    This handles many of the changes that have happened to extended
    statistic statistics over the various versions, including:
    
    * Format change for pg_ndistinct and pg_dependencies in current
      development version. Earlier versions have the format translated via
      the pg_dump SQL statement.
    
    * Inherited extended statistics were introduced in v15.
    
    * Expressions were introduced to extended statistics in v14.
    
    * MCV extended statistics were introduced in v13.
    
    * pg_statistic_ext_data and pg_stats_ext introduced in v12, prior to
      that ndstinct and depdendencies data (the only kind of stats that
      existed were directly on pg_statistic_ext.
    
    * Extended Statistics were introduced in v10, so there is no support for
      prior versions necessary.
    coreyhuinker authored and Commitfest Bot committed Aug 1, 2025
    Configuration menu
    Copy the full SHA
    8344a2a View commit details
    Browse the repository at this point in the history
  6. [CF 5517] v4 - Extended Statistics set/restore/clear functions

    This branch was automatically generated by a robot using patches from an
    email thread registered at:
    
    https://commitfest.postgresql.org/patch/5517
    
    The branch will be overwritten each time a new patch version is posted to
    the thread, and also periodically to check for bitrot caused by changes
    on the master branch.
    
    Patch(es): https://www.postgresql.org/message-id/CADkLM=daHJhUf-sO1iD=UTaymbBVEgEW4Sxm8PtHWWDEGWW9jQ@mail.gmail.com
    Author(s): Corey Huinker
    Commitfest Bot committed Aug 1, 2025
    Configuration menu
    Copy the full SHA
    64b0e9b View commit details
    Browse the repository at this point in the history
Loading