PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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)
 

Function Documentation

int get_tablespace_io_concurrency ( Oid  spcid)

Definition at line 204 of file spccache.c.

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

Referenced by ExecInitBitmapHeapScan().

205 {
206  TableSpaceCacheEntry *spc = get_tablespace(spcid);
207 
208  if (!spc->opts || spc->opts->effective_io_concurrency < 0)
210  else
211  return spc->opts->effective_io_concurrency;
212 }
static TableSpaceCacheEntry * get_tablespace(Oid spcid)
Definition: spccache.c:107
TableSpaceOpts * opts
Definition: spccache.c:40
int effective_io_concurrency
Definition: bufmgr.c:112
int effective_io_concurrency
Definition: tablespace.h:42
void get_tablespace_page_costs ( Oid  spcid,
float8 spc_random_page_cost,
float8 spc_seq_page_cost 
)

Definition at line 178 of file spccache.c.

References Assert, get_tablespace(), NULL, 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_tidscan(), genericcostestimate(), gincostestimate(), and system_time_samplescangetsamplesize().

181 {
182  TableSpaceCacheEntry *spc = get_tablespace(spcid);
183 
184  Assert(spc != NULL);
185 
186  if (spc_random_page_cost)
187  {
188  if (!spc->opts || spc->opts->random_page_cost < 0)
189  *spc_random_page_cost = random_page_cost;
190  else
191  *spc_random_page_cost = spc->opts->random_page_cost;
192  }
193 
194  if (spc_seq_page_cost)
195  {
196  if (!spc->opts || spc->opts->seq_page_cost < 0)
197  *spc_seq_page_cost = seq_page_cost;
198  else
199  *spc_seq_page_cost = spc->opts->seq_page_cost;
200  }
201 }
static TableSpaceCacheEntry * get_tablespace(Oid spcid)
Definition: spccache.c:107
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:105
#define NULL
Definition: c.h:226
#define Assert(condition)
Definition: c.h:670
double seq_page_cost
Definition: costsize.c:104