Commit 9efa998a authored by Stephen Frost's avatar Stephen Frost

Use maintenance_io_concurrency for ANALYZE prefetch

When prefetching pages for ANALYZE, we should be using
maintenance_io_concurrenty (by calling
get_tablespace_maintenance_io_concurrency(), not
get_tablespace_io_concurrency()).

ANALYZE prefetching was introduced in c6fc50cb, so back-patch to 14.

Backpatch-through: 14
Reported-By: Egor Rogov
Discussion: https://postgr.es/m/9beada99-34ce-8c95-fadb-451768d08c64%40postgrespro.ru
parent 8f6c1103
...@@ -1164,7 +1164,7 @@ acquire_sample_rows(Relation onerel, int elevel, ...@@ -1164,7 +1164,7 @@ acquire_sample_rows(Relation onerel, int elevel,
nblocks = BlockSampler_Init(&bs, totalblocks, targrows, randseed); nblocks = BlockSampler_Init(&bs, totalblocks, targrows, randseed);
#ifdef USE_PREFETCH #ifdef USE_PREFETCH
prefetch_maximum = get_tablespace_io_concurrency(onerel->rd_rel->reltablespace); prefetch_maximum = get_tablespace_maintenance_io_concurrency(onerel->rd_rel->reltablespace);
/* Create another BlockSampler, using the same seed, for prefetching */ /* Create another BlockSampler, using the same seed, for prefetching */
if (prefetch_maximum) if (prefetch_maximum)
(void) BlockSampler_Init(&prefetch_bs, totalblocks, targrows, randseed); (void) BlockSampler_Init(&prefetch_bs, totalblocks, targrows, randseed);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment