diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2015-09-08 12:51:42 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2015-09-08 12:51:42 -0300 |
commit | 1aba62ec635f5852bc45ce65482366e541e61ff5 (patch) | |
tree | 1161cc00324cb8d229b831a944432646ae1552d5 /src/backend/utils/cache | |
parent | 665a00c9e2598e3be366cb9f99c0a04a51dd8c7a (diff) | |
download | postgresql-1aba62ec635f5852bc45ce65482366e541e61ff5.tar.gz postgresql-1aba62ec635f5852bc45ce65482366e541e61ff5.zip |
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
Diffstat (limited to 'src/backend/utils/cache')
-rw-r--r-- | src/backend/utils/cache/spccache.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/backend/utils/cache/spccache.c b/src/backend/utils/cache/spccache.c index 1a0c884b248..1c78dfe76a1 100644 --- a/src/backend/utils/cache/spccache.c +++ b/src/backend/utils/cache/spccache.c @@ -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; +} |