2001-06-25 23:11:45 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* selfuncs.h
|
|
|
|
* Selectivity functions and index cost estimation functions for
|
|
|
|
* standard operators and index access methods.
|
|
|
|
*
|
|
|
|
*
|
2003-08-04 04:40:20 +02:00
|
|
|
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
2001-06-25 23:11:45 +02:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
|
|
*
|
2003-11-29 23:41:33 +01:00
|
|
|
* $PostgreSQL: pgsql/src/include/utils/selfuncs.h,v 1.16 2003/11/29 22:41:16 pgsql Exp $
|
2001-06-25 23:11:45 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
#ifndef SELFUNCS_H
|
|
|
|
#define SELFUNCS_H
|
|
|
|
|
|
|
|
#include "fmgr.h"
|
|
|
|
#include "nodes/parsenodes.h"
|
|
|
|
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
2001-10-28 07:26:15 +01:00
|
|
|
Pattern_Type_Like, Pattern_Type_Like_IC,
|
|
|
|
Pattern_Type_Regex, Pattern_Type_Regex_IC
|
2001-06-25 23:11:45 +02:00
|
|
|
} Pattern_Type;
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
2001-10-28 07:26:15 +01:00
|
|
|
Pattern_Prefix_None, Pattern_Prefix_Partial, Pattern_Prefix_Exact
|
2001-06-25 23:11:45 +02:00
|
|
|
} Pattern_Prefix_Status;
|
|
|
|
|
|
|
|
|
|
|
|
/* selfuncs.c */
|
|
|
|
|
2002-09-02 08:22:20 +02:00
|
|
|
extern Pattern_Prefix_Status pattern_fixed_prefix(Const *patt,
|
2001-06-25 23:11:45 +02:00
|
|
|
Pattern_Type ptype,
|
2002-09-02 08:22:20 +02:00
|
|
|
Const **prefix,
|
|
|
|
Const **rest);
|
|
|
|
extern Const *make_greater_string(const Const *str_const);
|
2001-06-25 23:11:45 +02:00
|
|
|
|
|
|
|
extern Datum eqsel(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum neqsel(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum scalarltsel(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum scalargtsel(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum regexeqsel(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum icregexeqsel(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum likesel(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum iclikesel(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum regexnesel(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum icregexnesel(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum nlikesel(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum icnlikesel(PG_FUNCTION_ARGS);
|
|
|
|
|
|
|
|
extern Datum eqjoinsel(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum neqjoinsel(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum scalarltjoinsel(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum scalargtjoinsel(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum regexeqjoinsel(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum icregexeqjoinsel(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum likejoinsel(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum iclikejoinsel(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum regexnejoinsel(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum icregexnejoinsel(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum nlikejoinsel(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum icnlikejoinsel(PG_FUNCTION_ARGS);
|
|
|
|
|
2002-10-19 04:56:16 +02:00
|
|
|
extern Selectivity booltestsel(Query *root, BoolTestType booltesttype,
|
2003-08-04 02:43:34 +02:00
|
|
|
Node *arg, int varRelid, JoinType jointype);
|
2002-10-19 04:56:16 +02:00
|
|
|
extern Selectivity nulltestsel(Query *root, NullTestType nulltesttype,
|
2003-08-04 02:43:34 +02:00
|
|
|
Node *arg, int varRelid);
|
2002-03-01 05:09:28 +01:00
|
|
|
|
|
|
|
extern void mergejoinscansel(Query *root, Node *clause,
|
2002-09-04 22:31:48 +02:00
|
|
|
Selectivity *leftscan,
|
|
|
|
Selectivity *rightscan);
|
2001-06-25 23:11:45 +02:00
|
|
|
|
2003-01-20 19:55:07 +01:00
|
|
|
extern double estimate_num_groups(Query *root, List *groupExprs,
|
2003-08-04 02:43:34 +02:00
|
|
|
double input_rows);
|
2002-11-20 00:22:00 +01:00
|
|
|
|
2001-06-25 23:11:45 +02:00
|
|
|
extern Datum btcostestimate(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum rtcostestimate(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum hashcostestimate(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum gistcostestimate(PG_FUNCTION_ARGS);
|
2001-10-28 07:26:15 +01:00
|
|
|
|
2001-11-05 18:46:40 +01:00
|
|
|
#endif /* SELFUNCS_H */
|