aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xlogprefetch.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2021-04-09 11:29:08 -0400
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2021-04-09 11:50:33 -0400
commit0e69f705cc1a3df273b38c9883fb5765991e04fe (patch)
tree31e8a0bb4305d1718ebff89d759fb87928399b89 /src/backend/access/transam/xlogprefetch.c
parent1798d8f8b6fbb8ff922f640ff2d5dbd3e47064a2 (diff)
downloadpostgresql-0e69f705cc1a3df273b38c9883fb5765991e04fe.tar.gz
postgresql-0e69f705cc1a3df273b38c9883fb5765991e04fe.zip
Set pg_class.reltuples for partitioned tables
When commit 0827e8af70f4 added auto-analyze support for partitioned tables, it included code to obtain reltuples for the partitioned table as a number of catalog accesses to read pg_class.reltuples for each partition. That's not only very inefficient, but also problematic because autovacuum doesn't hold any locks on any of those tables -- and doesn't want to. Replace that code with a read of pg_class.reltuples for the partitioned table, and make sure ANALYZE and TRUNCATE properly maintain that value. I found no code that would be affected by the change of relpages from zero to non-zero for partitioned tables, and no other code that should be maintaining it, but if there is, hopefully it'll be an easy fix. Per buildfarm. Author: Álvaro Herrera <alvherre@alvh.no-ip.org> Reviewed-by: Zhihong Yu <zyu@yugabyte.com> Discussion: https://postgr.es/m/1823909.1617862590@sss.pgh.pa.us
Diffstat (limited to 'src/backend/access/transam/xlogprefetch.c')
0 files changed, 0 insertions, 0 deletions