diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2023-07-03 07:09:22 +0200 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2023-07-03 07:18:57 +0200 |
commit | c69bdf837f161ae3e699496be10215dbb2315917 (patch) | |
tree | 155f49ccfffc575ae716d2e111525f4c6d4adaca /src/backend/utils/adt/array_typanalyze.c | |
parent | 7a7f60aef8bf86b1a94908e20edd107fa9da4f3d (diff) | |
download | postgresql-c69bdf837f161ae3e699496be10215dbb2315917.tar.gz postgresql-c69bdf837f161ae3e699496be10215dbb2315917.zip |
Take pg_attribute out of VacAttrStats
The VacAttrStats structure contained the whole Form_pg_attribute for a
column, but it actually only needs attstattarget from there. So
remove the Form_pg_attribute field and make a separate field for
attstattarget. This simplifies some code for extended statistics that
doesn't deal with a column but an expression, which had to fake up
pg_attribute rows to satisfy internal APIs. Also, we can remove some
comments that essentially said "don't look at pg_attribute directly".
Reviewed-by: Tomas Vondra <tomas.vondra@enterprisedb.com>
Discussion: https://www.postgresql.org/message-id/flat/d6069765-5971-04d3-c10d-e4f7b2e9c459%40eisentraut.org
Diffstat (limited to 'src/backend/utils/adt/array_typanalyze.c')
-rw-r--r-- | src/backend/utils/adt/array_typanalyze.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/adt/array_typanalyze.c b/src/backend/utils/adt/array_typanalyze.c index 52e160d6bbb..04b3764b686 100644 --- a/src/backend/utils/adt/array_typanalyze.c +++ b/src/backend/utils/adt/array_typanalyze.c @@ -263,7 +263,7 @@ compute_array_stats(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfunc, * the number of individual elements tracked in pg_statistic ought to be * more than the number of values for a simple scalar column. */ - num_mcelem = stats->attr->attstattarget * 10; + num_mcelem = stats->attstattarget * 10; /* * We set bucket width equal to num_mcelem / 0.007 as per the comment @@ -575,7 +575,7 @@ compute_array_stats(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfunc, count_items_count = hash_get_num_entries(count_tab); if (count_items_count > 0) { - int num_hist = stats->attr->attstattarget; + int num_hist = stats->attstattarget; DECountItem **sorted_count_items; int j; int delta; |