File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -6976,8 +6976,15 @@ heap_compute_xid_horizon_for_tuples(Relation rel,
6976
6976
* more prefetching in this case, too. It may be that this formula is too
6977
6977
* simplistic, but at the moment there is no evidence of that or any idea
6978
6978
* about what would work better.
6979
+ *
6980
+ * Since the caller holds a buffer lock somewhere in rel, we'd better make
6981
+ * sure that isn't a catalog relation before we call code that does
6982
+ * syscache lookups, to avoid risk of deadlock.
6979
6983
*/
6980
- io_concurrency = get_tablespace_io_concurrency (rel -> rd_rel -> reltablespace );
6984
+ if (IsCatalogRelation (rel ))
6985
+ io_concurrency = effective_io_concurrency ;
6986
+ else
6987
+ io_concurrency = get_tablespace_io_concurrency (rel -> rd_rel -> reltablespace );
6981
6988
prefetch_distance = Min ((io_concurrency ) + 10 , MAX_IO_CONCURRENCY );
6982
6989
6983
6990
/* Start prefetching. */
You can’t perform that action at this time.
0 commit comments