Use maintenance_io_concurrency for ANALYZE prefetch
authorStephen Frost <[email protected]>
Fri, 27 Aug 2021 23:23:14 +0000 (19:23 -0400)
committerStephen Frost <[email protected]>
Fri, 27 Aug 2021 23:23:14 +0000 (19:23 -0400)
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 c6fc50c, so back-patch to 14.

Backpatch-through: 14
Reported-By: Egor Rogov
Discussion: https://postgr.es/m/9beada99-34ce-8c95-fadb-451768d08c64%40postgrespro.ru

src/backend/commands/analyze.c

index b31426e2b21fc00dc917073179b5177a6ae0143a..03cdf4f5e8e3e3e65fca8c6cc155e8e39731093c 100644 (file)
@@ -1164,7 +1164,7 @@ acquire_sample_rows(Relation onerel, int elevel,
    nblocks = BlockSampler_Init(&bs, totalblocks, targrows, randseed);
 
 #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 */
    if (prefetch_maximum)
        (void) BlockSampler_Init(&prefetch_bs, totalblocks, targrows, randseed);