1996-07-09 08:22:35 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
1999-02-14 00:22:53 +01:00
|
|
|
* plancat.h
|
1997-09-07 07:04:48 +02:00
|
|
|
* prototypes for plancat.c.
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
|
|
|
*
|
|
|
|
* Copyright (c) 1994, Regents of the University of California
|
|
|
|
*
|
1999-02-14 00:22:53 +01:00
|
|
|
* $Id: plancat.h,v 1.11 1999/02/13 23:21:50 momjian Exp $
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
#ifndef PLANCAT_H
|
|
|
|
#define PLANCAT_H
|
|
|
|
|
1996-11-06 10:24:57 +01:00
|
|
|
#include <nodes/parsenodes.h>
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* transient data structure to hold return value of index_info. Note that
|
|
|
|
* indexkeys, orderOprs and classlist is "null-terminated".
|
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
typedef struct IdxInfoRetval
|
|
|
|
{
|
1997-09-08 04:41:22 +02:00
|
|
|
Oid relid; /* OID of the index relation (not the OID
|
1997-09-07 07:04:48 +02:00
|
|
|
* of the relation being indexed) */
|
1997-09-08 04:41:22 +02:00
|
|
|
Oid relam; /* OID of the pg_am of this index */
|
|
|
|
int pages; /* number of pages in the index relation */
|
|
|
|
int tuples; /* number of tuples in the index relation */
|
|
|
|
int *indexkeys; /* keys over which we're indexing */
|
|
|
|
Oid *orderOprs; /* operators used for ordering purposes */
|
|
|
|
Oid *classlist; /* classes of AM operators */
|
|
|
|
Oid indproc;
|
|
|
|
Node *indpred;
|
1997-09-08 23:56:23 +02:00
|
|
|
} IdxInfoRetval;
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
extern void relation_info(Query *root,
|
1997-09-07 07:04:48 +02:00
|
|
|
Oid relid,
|
1997-09-08 23:56:23 +02:00
|
|
|
bool *hashindex, int *pages,
|
1996-07-09 08:22:35 +02:00
|
|
|
int *tuples);
|
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
extern bool index_info(Query *root,
|
1997-09-08 23:56:23 +02:00
|
|
|
bool first, int relid, IdxInfoRetval *info);
|
1996-07-09 08:22:35 +02:00
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
extern Cost restriction_selectivity(Oid functionObjectId,
|
1997-09-07 07:04:48 +02:00
|
|
|
Oid operatorObjectId,
|
|
|
|
Oid relationObjectId,
|
|
|
|
AttrNumber attributeNumber,
|
|
|
|
char *constValue,
|
|
|
|
int32 constFlag);
|
1996-07-09 08:22:35 +02:00
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
extern void index_selectivity(Oid indid, Oid *classes, List *opnos,
|
1997-09-08 23:56:23 +02:00
|
|
|
Oid relid, List *attnos, List *values, List *flags,
|
1997-09-07 07:04:48 +02:00
|
|
|
int32 nkeys, float *idxPages, float *idxSelec);
|
1996-07-09 08:22:35 +02:00
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
extern Cost join_selectivity(Oid functionObjectId, Oid operatorObjectId,
|
1997-09-07 07:04:48 +02:00
|
|
|
Oid relationObjectId1, AttrNumber attributeNumber1,
|
|
|
|
Oid relationObjectId2, AttrNumber attributeNumber2);
|
1996-07-09 08:22:35 +02:00
|
|
|
|
1997-09-08 04:41:22 +02:00
|
|
|
extern List *find_inheritance_children(Oid inhparent);
|
1996-07-09 08:22:35 +02:00
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
#endif /* PLANCAT_H */
|