mirror of
https://github.com/postgres/postgres.git
synced 2025-11-22 12:22:45 +03:00
pgstat: introduce pgstat_relation_should_count().
A later commit will make the check more complicated than the current (rel)->pgstat_info != NULL. It also just seems nicer to have a central copy of the logic, even while still simple. Author: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/20220303021600.hs34ghqcw6zcokdh@alap3.anarazel.de
This commit is contained in:
@@ -1743,7 +1743,7 @@ index_concurrently_swap(Oid newIndexId, Oid oldIndexId, const char *oldName)
|
||||
tabentry = pgstat_fetch_stat_tabentry(oldIndexId);
|
||||
if (tabentry)
|
||||
{
|
||||
if (newClassRel->pgstat_info)
|
||||
if (pgstat_relation_should_count(newClassRel))
|
||||
{
|
||||
newClassRel->pgstat_info->t_counts.t_numscans = tabentry->numscans;
|
||||
newClassRel->pgstat_info->t_counts.t_tuples_returned = tabentry->tuples_returned;
|
||||
|
||||
Reference in New Issue
Block a user