1 /*-------------------------------------------------------------------------
4 * Selectivity functions and index cost estimation functions for
5 * standard operators and index access methods.
8 * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
9 * Portions Copyright (c) 1994, Regents of the University of California
11 * $Id: selfuncs.h,v 1.15 2003/08/04 02:40:15 momjian Exp $
13 *-------------------------------------------------------------------------
19 #include "nodes/parsenodes.h"
24 Pattern_Type_Like, Pattern_Type_Like_IC,
25 Pattern_Type_Regex, Pattern_Type_Regex_IC
30 Pattern_Prefix_None, Pattern_Prefix_Partial, Pattern_Prefix_Exact
31 } Pattern_Prefix_Status;
36 extern Pattern_Prefix_Status pattern_fixed_prefix(Const *patt,
40 extern Const *make_greater_string(const Const *str_const);
42 extern Datum eqsel(PG_FUNCTION_ARGS);
43 extern Datum neqsel(PG_FUNCTION_ARGS);
44 extern Datum scalarltsel(PG_FUNCTION_ARGS);
45 extern Datum scalargtsel(PG_FUNCTION_ARGS);
46 extern Datum regexeqsel(PG_FUNCTION_ARGS);
47 extern Datum icregexeqsel(PG_FUNCTION_ARGS);
48 extern Datum likesel(PG_FUNCTION_ARGS);
49 extern Datum iclikesel(PG_FUNCTION_ARGS);
50 extern Datum regexnesel(PG_FUNCTION_ARGS);
51 extern Datum icregexnesel(PG_FUNCTION_ARGS);
52 extern Datum nlikesel(PG_FUNCTION_ARGS);
53 extern Datum icnlikesel(PG_FUNCTION_ARGS);
55 extern Datum eqjoinsel(PG_FUNCTION_ARGS);
56 extern Datum neqjoinsel(PG_FUNCTION_ARGS);
57 extern Datum scalarltjoinsel(PG_FUNCTION_ARGS);
58 extern Datum scalargtjoinsel(PG_FUNCTION_ARGS);
59 extern Datum regexeqjoinsel(PG_FUNCTION_ARGS);
60 extern Datum icregexeqjoinsel(PG_FUNCTION_ARGS);
61 extern Datum likejoinsel(PG_FUNCTION_ARGS);
62 extern Datum iclikejoinsel(PG_FUNCTION_ARGS);
63 extern Datum regexnejoinsel(PG_FUNCTION_ARGS);
64 extern Datum icregexnejoinsel(PG_FUNCTION_ARGS);
65 extern Datum nlikejoinsel(PG_FUNCTION_ARGS);
66 extern Datum icnlikejoinsel(PG_FUNCTION_ARGS);
68 extern Selectivity booltestsel(Query *root, BoolTestType booltesttype,
69 Node *arg, int varRelid, JoinType jointype);
70 extern Selectivity nulltestsel(Query *root, NullTestType nulltesttype,
71 Node *arg, int varRelid);
73 extern void mergejoinscansel(Query *root, Node *clause,
74 Selectivity *leftscan,
75 Selectivity *rightscan);
77 extern double estimate_num_groups(Query *root, List *groupExprs,
80 extern Datum btcostestimate(PG_FUNCTION_ARGS);
81 extern Datum rtcostestimate(PG_FUNCTION_ARGS);
82 extern Datum hashcostestimate(PG_FUNCTION_ARGS);
83 extern Datum gistcostestimate(PG_FUNCTION_ARGS);
85 #endif /* SELFUNCS_H */