2001-06-25 23:11:45 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* selfuncs.h
|
|
|
|
* Selectivity functions and index cost estimation functions for
|
|
|
|
* standard operators and index access methods.
|
|
|
|
*
|
|
|
|
*
|
2002-06-20 22:29:54 +02:00
|
|
|
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
2001-06-25 23:11:45 +02:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
|
|
*
|
2002-10-19 04:56:16 +02:00
|
|
|
* $Id: selfuncs.h,v 1.9 2002/10/19 02:56:16 tgl 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);
|
2001-06-25 23:11:45 +02:00
|
|
|
extern bool locale_is_like_safe(void);
|
2002-09-02 08:22:20 +02:00
|
|
|
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,
|
|
|
|
Node *arg, int varRelid);
|
|
|
|
extern Selectivity nulltestsel(Query *root, NullTestType nulltesttype,
|
|
|
|
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
|
|
|
|
|
|
|
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 */
|