1996-07-09 08:22:35 +02: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-02-12 07:43:53 +01:00
|
|
|
* $Id: cost.h,v 1.15 1999/02/12 06:43:52 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/nodes.h"
|
|
|
|
#include "nodes/parsenodes.h"
|
|
|
|
#include "nodes/pg_list.h"
|
|
|
|
#include "nodes/relation.h"
|
|
|
|
|
1996-07-09 08:22:35 +02: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_hash_;
|
|
|
|
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_;
|
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-02-10 04:52:54 +01:00
|
|
|
extern Cost cost_sort(List *pathkeys, int tuples, int width, bool noread);
|
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);
|
1998-09-01 06:40:42 +02:00
|
|
|
extern Cost cost_hashjoin(Cost outercost, Cost innercost, List *outerkeys,
|
1997-09-08 23:56:23 +02:00
|
|
|
List *innerkeys, int outersize, int innersize,
|
1997-09-07 07:04:48 +02:00
|
|
|
int outerwidth, int innerwidth);
|
1999-02-10 22:02:50 +01:00
|
|
|
extern int compute_rel_size(RelOptInfo *rel);
|
|
|
|
extern int compute_rel_width(RelOptInfo *rel);
|
1999-02-12 07:43:53 +01:00
|
|
|
extern int compute_joinrel_size(NestPath *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
|
|
|
|
|
|
|
/*
|
|
|
|
* 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);
|
1998-09-01 06:40:42 +02:00
|
|
|
extern Cost compute_clause_selec(Query *root,
|
1997-09-08 23:56:23 +02:00
|
|
|
Node *clause, List *or_selectivities);
|
1996-07-09 08:22:35 +02:00
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
#endif /* COST_H */
|