Re: Statistics Import and Export - Mailing list pgsql-hackers

From Corey Huinker
Subject Re: Statistics Import and Export
Date
Msg-id CADkLM=e0jM7m0GFV44nNtvL22CtnFUu+pekppCVE=DOBe58RTQ@mail.gmail.com
Whole thread Raw
In response to Re: Statistics Import and Export  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-hackers

> WARNING:  invalid input syntax for type integer: "four"
>  row_written |          stats_applied           |          
>  stats_rejected            | params_rejected
> -------------+----------------------------------+--------------------
> ------------------+-----------------
>  t           | {null_frac,avg_width,n_distinct} |
> {most_common_vals,most_common_freqs} |
> (1 row)

I think I like this, as well, except for the return value, which seems
like too much information and a bit over-engineered. Can we simplify it
to what's actually going to be used by pg_upgrade and other tools?

pg_upgrade currently won't need any of it, it currently does nothing when a statistics import fails. But it could do *something* based on this information. For example, we might have an option --analyze-tables-that-have-a-statistics-import-failure that analyzes tables that have at least one statistics that didn't import. For instance, postgres_fdw may try to do stats import first, and if that fails fall back to a remote table sample.

We could do other things. It seems a shame to just throw away this information when it could potentially be used in the future.
 

> Attached is v25.

I believe 0001 and 0002 are in good shape API-wise, and I can start
getting those committed. I will try to clean up the code in the
process.

:) 

pgsql-hackers by date:

Previous
From: Robert Treat
Date:
Subject: Re: PG 17 and GUC variables
Next
From: Imran Zaheer
Date:
Subject: Re: SQL Property Graph Queries (SQL/PGQ)