Take pg_attribute out of VacAttrStats
authorPeter Eisentraut <peter@eisentraut.org>
Mon, 3 Jul 2023 05:09:22 +0000 (07:09 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Mon, 3 Jul 2023 05:18:57 +0000 (07:18 +0200)
commitc69bdf837f161ae3e699496be10215dbb2315917
tree155f49ccfffc575ae716d2e111525f4c6d4adaca
parent7a7f60aef8bf86b1a94908e20edd107fa9da4f3d
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
src/backend/commands/analyze.c
src/backend/statistics/extended_stats.c
src/backend/tsearch/ts_typanalyze.c
src/backend/utils/adt/array_typanalyze.c
src/backend/utils/adt/rangetypes_typanalyze.c
src/include/commands/vacuum.h