mirror of
https://github.com/postgres/postgres.git
synced 2025-09-11 00:12:06 +03:00
Add is_analyze parameter to vacuum_delay_point().
This function is used in both vacuum and analyze code paths, and a follow-up commit will require distinguishing between the two. This commit forces callers to specify whether they are in a vacuum or analyze path, but it does not use that information for anything yet. Author: Nathan Bossart <nathandbossart@gmail.com> Co-authored-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com> Discussion: https://postgr.es/m/ZmaXmWDL829fzAVX%40ip-10-97-1-34.eu-west-3.compute.internal
This commit is contained in:
@@ -915,7 +915,7 @@ compute_index_stats(Relation onerel, double totalrows,
|
||||
{
|
||||
HeapTuple heapTuple = rows[rowno];
|
||||
|
||||
vacuum_delay_point();
|
||||
vacuum_delay_point(true);
|
||||
|
||||
/*
|
||||
* Reset the per-tuple context each time, to reclaim any cruft
|
||||
@@ -1238,7 +1238,7 @@ acquire_sample_rows(Relation onerel, int elevel,
|
||||
/* Outer loop over blocks to sample */
|
||||
while (table_scan_analyze_next_block(scan, stream))
|
||||
{
|
||||
vacuum_delay_point();
|
||||
vacuum_delay_point(true);
|
||||
|
||||
while (table_scan_analyze_next_tuple(scan, OldestXmin, &liverows, &deadrows, slot))
|
||||
{
|
||||
@@ -1970,7 +1970,7 @@ compute_trivial_stats(VacAttrStatsP stats,
|
||||
Datum value;
|
||||
bool isnull;
|
||||
|
||||
vacuum_delay_point();
|
||||
vacuum_delay_point(true);
|
||||
|
||||
value = fetchfunc(stats, i, &isnull);
|
||||
|
||||
@@ -2086,7 +2086,7 @@ compute_distinct_stats(VacAttrStatsP stats,
|
||||
int firstcount1,
|
||||
j;
|
||||
|
||||
vacuum_delay_point();
|
||||
vacuum_delay_point(true);
|
||||
|
||||
value = fetchfunc(stats, i, &isnull);
|
||||
|
||||
@@ -2433,7 +2433,7 @@ compute_scalar_stats(VacAttrStatsP stats,
|
||||
Datum value;
|
||||
bool isnull;
|
||||
|
||||
vacuum_delay_point();
|
||||
vacuum_delay_point(true);
|
||||
|
||||
value = fetchfunc(stats, i, &isnull);
|
||||
|
||||
|
@@ -2373,7 +2373,7 @@ vac_close_indexes(int nindexes, Relation *Irel, LOCKMODE lockmode)
|
||||
* typically once per page processed.
|
||||
*/
|
||||
void
|
||||
vacuum_delay_point(void)
|
||||
vacuum_delay_point(bool is_analyze)
|
||||
{
|
||||
double msec = 0;
|
||||
|
||||
|
Reference in New Issue
Block a user