mirror of
https://github.com/postgres/postgres.git
synced 2025-10-16 17:07:43 +03:00
Allow per-tablespace effective_io_concurrency
Per discussion, nowadays it is possible to have tablespaces that have wildly different I/O characteristics from others. Setting different effective_io_concurrency parameters for those has been measured to improve performance. Author: Julien Rouhaud Reviewed by: Andres Freund
This commit is contained in:
12
src/backend/utils/cache/spccache.c
vendored
12
src/backend/utils/cache/spccache.c
vendored
@@ -23,6 +23,7 @@
|
||||
#include "commands/tablespace.h"
|
||||
#include "miscadmin.h"
|
||||
#include "optimizer/cost.h"
|
||||
#include "storage/bufmgr.h"
|
||||
#include "utils/catcache.h"
|
||||
#include "utils/hsearch.h"
|
||||
#include "utils/inval.h"
|
||||
@@ -198,3 +199,14 @@ get_tablespace_page_costs(Oid spcid,
|
||||
*spc_seq_page_cost = spc->opts->seq_page_cost;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
get_tablespace_io_concurrency(Oid spcid)
|
||||
{
|
||||
TableSpaceCacheEntry *spc = get_tablespace(spcid);
|
||||
|
||||
if (!spc->opts || spc->opts->effective_io_concurrency < 0)
|
||||
return effective_io_concurrency;
|
||||
else
|
||||
return spc->opts->effective_io_concurrency;
|
||||
}
|
||||
|
Reference in New Issue
Block a user