PostgreSQL Source Code  git master
spccache.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void get_tablespace_page_costs (Oid spcid, float8 *spc_random_page_cost, float8 *spc_seq_page_cost)
 
int get_tablespace_io_concurrency (Oid spcid)
 
int get_tablespace_maintenance_io_concurrency (Oid spcid)
 

Function Documentation

◆ get_tablespace_io_concurrency()

int get_tablespace_io_concurrency ( Oid  spcid)

Definition at line 214 of file spccache.c.

References TableSpaceOpts::effective_io_concurrency, effective_io_concurrency, get_tablespace(), and TableSpaceCacheEntry::opts.

Referenced by ExecInitBitmapHeapScan().

215 {
216  TableSpaceCacheEntry *spc = get_tablespace(spcid);
217 
218  if (!spc->opts || spc->opts->effective_io_concurrency < 0)
220  else
221  return spc->opts->effective_io_concurrency;
222 }
static TableSpaceCacheEntry * get_tablespace(Oid spcid)
Definition: spccache.c:106
TableSpaceOpts * opts
Definition: spccache.c:40
int effective_io_concurrency
Definition: bufmgr.c:143
int effective_io_concurrency
Definition: tablespace.h:42

◆ get_tablespace_maintenance_io_concurrency()

int get_tablespace_maintenance_io_concurrency ( Oid  spcid)

Definition at line 228 of file spccache.c.

References get_tablespace(), TableSpaceOpts::maintenance_io_concurrency, maintenance_io_concurrency, and TableSpaceCacheEntry::opts.

Referenced by acquire_sample_rows(), and heap_index_delete_tuples().

229 {
230  TableSpaceCacheEntry *spc = get_tablespace(spcid);
231 
232  if (!spc->opts || spc->opts->maintenance_io_concurrency < 0)
234  else
235  return spc->opts->maintenance_io_concurrency;
236 }
int maintenance_io_concurrency
Definition: tablespace.h:43
int maintenance_io_concurrency
Definition: bufmgr.c:150
static TableSpaceCacheEntry * get_tablespace(Oid spcid)
Definition: spccache.c:106
TableSpaceOpts * opts
Definition: spccache.c:40

◆ get_tablespace_page_costs()

void get_tablespace_page_costs ( Oid  spcid,
float8 spc_random_page_cost,
float8 spc_seq_page_cost 
)

Definition at line 181 of file spccache.c.

References Assert, get_tablespace(), TableSpaceCacheEntry::opts, TableSpaceOpts::random_page_cost, random_page_cost, TableSpaceOpts::seq_page_cost, and seq_page_cost.

Referenced by brincostestimate(), cost_bitmap_heap_scan(), cost_index(), cost_samplescan(), cost_seqscan(), cost_tidrangescan(), cost_tidscan(), genericcostestimate(), gincostestimate(), and system_time_samplescangetsamplesize().

184 {
185  TableSpaceCacheEntry *spc = get_tablespace(spcid);
186 
187  Assert(spc != NULL);
188 
189  if (spc_random_page_cost)
190  {
191  if (!spc->opts || spc->opts->random_page_cost < 0)
192  *spc_random_page_cost = random_page_cost;
193  else
194  *spc_random_page_cost = spc->opts->random_page_cost;
195  }
196 
197  if (spc_seq_page_cost)
198  {
199  if (!spc->opts || spc->opts->seq_page_cost < 0)
200  *spc_seq_page_cost = seq_page_cost;
201  else
202  *spc_seq_page_cost = spc->opts->seq_page_cost;
203  }
204 }
static TableSpaceCacheEntry * get_tablespace(Oid spcid)
Definition: spccache.c:106
float8 random_page_cost
Definition: tablespace.h:40
TableSpaceOpts * opts
Definition: spccache.c:40
float8 seq_page_cost
Definition: tablespace.h:41
double random_page_cost
Definition: costsize.c:120
#define Assert(condition)
Definition: c.h:804
double seq_page_cost
Definition: costsize.c:119