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
|
|
|
|
*
|
1999-11-23 21:07:06 +01:00
|
|
|
* $Id: cost.h,v 1.24 1999/11/23 20:07:05 momjian 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
|
|
|
|
1997-09-08 04:41:22 +02:00
|
|
|
extern Cost cost_seqscan(int relid, int relpages, int reltuples);
|
1998-09-01 06:40:42 +02:00
|
|
|
extern Cost cost_index(Oid indexid, int expected_indexpages, Cost selec,
|
1997-09-07 07:04:48 +02:00
|
|
|
int relpages, int reltuples, int indexpages,
|
|
|
|
int indextuples, bool is_injoin);
|
1999-11-23 21:07:06 +01:00
|
|
|
extern Cost cost_tidscan(List *evallist);
|
1999-05-01 21:47:42 +02:00
|
|
|
extern Cost cost_sort(List *pathkeys, int tuples, int width);
|
1998-09-01 06:40:42 +02:00
|
|
|
extern Cost cost_nestloop(Cost outercost, Cost innercost, int outertuples,
|
1997-09-07 07:04:48 +02:00
|
|
|
int innertuples, int outerpages, bool is_indexjoin);
|
1998-09-01 06:40:42 +02:00
|
|
|
extern Cost cost_mergejoin(Cost outercost, Cost innercost,
|
1997-09-08 23:56:23 +02:00
|
|
|
List *outersortkeys, List *innersortkeys,
|
1997-09-07 07:04:48 +02:00
|
|
|
int outersize, int innersize, int outerwidth, int innerwidth);
|
1999-08-06 06:00:17 +02:00
|
|
|
extern Cost cost_hashjoin(Cost outercost, Cost innercost,
|
|
|
|
int outersize, int innersize,
|
|
|
|
int outerwidth, int innerwidth,
|
|
|
|
Cost innerdisbursion);
|
1999-05-26 00:43:53 +02:00
|
|
|
extern int compute_rel_size(RelOptInfo *rel);
|
|
|
|
extern int compute_rel_width(RelOptInfo *rel);
|
1999-02-12 18:25:05 +01:00
|
|
|
extern int compute_joinrel_size(JoinPath *joinpath);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern int page_size(int tuples, int width);
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
/*
|
1999-02-14 00:22:53 +01:00
|
|
|
* prototypes for fuctions in clausesel.h
|
1997-09-07 07:04:48 +02:00
|
|
|
* routines to compute clause selectivities
|
1996-07-09 08:22:35 +02:00
|
|
|
*/
|
1999-02-03 21:15:53 +01:00
|
|
|
extern void set_clause_selectivities(List *restrictinfo_list, Cost new_selectivity);
|
|
|
|
extern Cost product_selec(List *restrictinfo_list);
|
1997-09-08 23:56:23 +02:00
|
|
|
extern void set_rest_relselec(Query *root, List *rel_list);
|
1999-02-03 21:15:53 +01:00
|
|
|
extern void set_rest_selec(Query *root, List *restrictinfo_list);
|
1999-07-25 01:21:14 +02:00
|
|
|
extern Cost 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 */
|