mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
Optimizer can now estimate selectivity of IS NULL, IS NOT NULL,
IS TRUE, etc, with some degree of verisimilitude. Split out selectivity support functions from builtins.h into a new header file selfuncs.h, so as to reduce the number of header files builtins.h must depend on. Fix a few missing inclusions exposed thereby. From Joe Conway, with some kibitzing from Tom Lane.
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: builtins.h,v 1.155 2001/06/17 02:05:20 tgl Exp $
|
||||
* $Id: builtins.h,v 1.156 2001/06/25 21:11:45 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -15,9 +15,8 @@
|
||||
#define BUILTINS_H
|
||||
|
||||
#include "fmgr.h"
|
||||
#include "nodes/relation.h" /* for amcostestimate parameters */
|
||||
#include "storage/itemptr.h"
|
||||
#include "utils/numeric.h"
|
||||
#include "nodes/primnodes.h"
|
||||
|
||||
|
||||
/*
|
||||
* Defined in adt/
|
||||
@ -342,57 +341,6 @@ extern char *deparse_expression(Node *expr, List *dpcontext,
|
||||
bool forceprefix);
|
||||
extern List *deparse_context_for(char *relname, Oid relid);
|
||||
|
||||
/* selfuncs.c */
|
||||
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);
|
||||
|
||||
extern Datum btcostestimate(PG_FUNCTION_ARGS);
|
||||
extern Datum rtcostestimate(PG_FUNCTION_ARGS);
|
||||
extern Datum hashcostestimate(PG_FUNCTION_ARGS);
|
||||
extern Datum gistcostestimate(PG_FUNCTION_ARGS);
|
||||
|
||||
/* selfuncs.c supporting routines that are also used by optimizer code */
|
||||
typedef enum
|
||||
{
|
||||
Pattern_Type_Like, Pattern_Type_Like_IC,
|
||||
Pattern_Type_Regex, Pattern_Type_Regex_IC
|
||||
} Pattern_Type;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
Pattern_Prefix_None, Pattern_Prefix_Partial, Pattern_Prefix_Exact
|
||||
} Pattern_Prefix_Status;
|
||||
|
||||
extern Pattern_Prefix_Status pattern_fixed_prefix(char *patt,
|
||||
Pattern_Type ptype,
|
||||
char **prefix,
|
||||
char **rest);
|
||||
extern bool locale_is_like_safe(void);
|
||||
extern char *make_greater_string(const char *str, Oid datatype);
|
||||
|
||||
/* tid.c */
|
||||
extern Datum tidin(PG_FUNCTION_ARGS);
|
||||
extern Datum tidout(PG_FUNCTION_ARGS);
|
||||
|
Reference in New Issue
Block a user