1996-07-09 08:22:35 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
1999-02-14 00:22:53 +01:00
|
|
|
* cost.h
|
1997-09-07 07:04:48 +02:00
|
|
|
* prototypes for costsize.c and clausesel.c.
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
|
|
|
*
|
|
|
|
* Copyright (c) 1994, Regents of the University of California
|
|
|
|
*
|
2000-01-09 01:26:47 +01:00
|
|
|
* $Id: cost.h,v 1.25 2000/01/09 00:26:46 tgl Exp $
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
#ifndef COST_H
|
|
|
|
#define COST_H
|
|
|
|
|
1997-11-26 02:14:33 +01:00
|
|
|
#include "nodes/relation.h"
|
|
|
|
|
1999-07-15 17:21:54 +02:00
|
|
|
/* defaults for function attributes used for expensive function calculations */
|
|
|
|
#define BYTE_PCT 100
|
|
|
|
#define PERBYTE_CPU 0
|
|
|
|
#define PERCALL_CPU 0
|
|
|
|
#define OUTIN_RATIO 100
|
|
|
|
|
1996-07-09 08:22:35 +02:00
|
|
|
/*
|
1999-02-14 00:22:53 +01:00
|
|
|
* prototypes for costsize.c
|
1997-09-07 07:04:48 +02:00
|
|
|
* routines to compute costs and sizes
|
|
|
|
*/
|
1997-09-08 04:41:22 +02:00
|
|
|
extern bool _enable_seqscan_;
|
|
|
|
extern bool _enable_indexscan_;
|
|
|
|
extern bool _enable_sort_;
|
|
|
|
extern bool _enable_nestloop_;
|
1998-08-04 18:44:31 +02:00
|
|
|
extern bool _enable_mergejoin_;
|
1997-09-08 04:41:22 +02:00
|
|
|
extern bool _enable_hashjoin_;
|
1999-11-23 21:07:06 +01:00
|
|
|
extern bool _enable_tidscan_;
|
1996-07-09 08:22:35 +02:00
|
|
|
|
2000-01-09 01:26:47 +01:00
|
|
|
extern Cost cost_seqscan(RelOptInfo *baserel);
|
|
|
|
extern Cost cost_index(RelOptInfo *baserel, IndexOptInfo *index,
|
|
|
|
long expected_indexpages, Selectivity selec,
|
|
|
|
bool is_injoin);
|
|
|
|
extern Cost cost_tidscan(RelOptInfo *baserel, List *tideval);
|
|
|
|
extern Cost cost_sort(List *pathkeys, double tuples, int width);
|
|
|
|
extern Cost cost_nestloop(Path *outer_path, Path *inner_path,
|
|
|
|
bool is_indexjoin);
|
|
|
|
extern Cost cost_mergejoin(Path *outer_path, Path *inner_path,
|
|
|
|
List *outersortkeys, List *innersortkeys);
|
|
|
|
extern Cost cost_hashjoin(Path *outer_path, Path *inner_path,
|
|
|
|
Selectivity innerdisbursion);
|
|
|
|
extern void set_rel_rows_width(Query *root, RelOptInfo *rel);
|
|
|
|
extern void set_joinrel_rows_width(Query *root, RelOptInfo *rel,
|
|
|
|
JoinPath *joinpath);
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
/*
|
2000-01-09 01:26:47 +01:00
|
|
|
* prototypes for clausesel.c
|
1997-09-07 07:04:48 +02:00
|
|
|
* routines to compute clause selectivities
|
1996-07-09 08:22:35 +02:00
|
|
|
*/
|
2000-01-09 01:26:47 +01:00
|
|
|
extern Selectivity restrictlist_selec(Query *root, List *restrictinfo_list);
|
|
|
|
extern Selectivity clauselist_selec(Query *root, List *clauses);
|
|
|
|
extern Selectivity compute_clause_selec(Query *root, Node *clause);
|
1996-07-09 08:22:35 +02:00
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
#endif /* COST_H */
|