OSDN Git Service

Massive commit to run PGINDENT on all *.c and *.h files.
[pg-rex/syncrep.git] / src / include / optimizer / plancat.h
1 /*-------------------------------------------------------------------------
2  *
3  * plancat.h--
4  *        prototypes for plancat.c.
5  *
6  *
7  * Copyright (c) 1994, Regents of the University of California
8  *
9  * $Id: plancat.h,v 1.4 1997/09/07 04:59:15 momjian Exp $
10  *
11  *-------------------------------------------------------------------------
12  */
13 #ifndef PLANCAT_H
14 #define PLANCAT_H
15
16 #include <nodes/parsenodes.h>
17
18 /*
19  * transient data structure to hold return value of index_info. Note that
20  * indexkeys, orderOprs and classlist is "null-terminated".
21  */
22 typedef struct IdxInfoRetval
23 {
24         Oid                             relid;          /* OID of the index relation (not the OID
25                                                                  * of the relation being indexed) */
26         Oid                             relam;          /* OID of the pg_am of this index */
27         int                             pages;          /* number of pages in the index relation */
28         int                             tuples;         /* number of tuples in the index relation */
29         int                        *indexkeys;  /* keys over which we're indexing */
30         Oid                        *orderOprs;  /* operators used for ordering purposes */
31         Oid                        *classlist;  /* classes of AM operators */
32         Oid                             indproc;
33         Node               *indpred;
34 }                               IdxInfoRetval;
35
36
37 extern void
38 relation_info(Query * root,
39                           Oid relid,
40                           bool * hashindex, int *pages,
41                           int *tuples);
42
43 extern bool
44 index_info(Query * root,
45                    bool first, int relid, IdxInfoRetval * info);
46
47 extern                  Cost
48 restriction_selectivity(Oid functionObjectId,
49                                                 Oid operatorObjectId,
50                                                 Oid relationObjectId,
51                                                 AttrNumber attributeNumber,
52                                                 char *constValue,
53                                                 int32 constFlag);
54
55 extern void
56 index_selectivity(Oid indid, Oid * classes, List * opnos,
57                                   Oid relid, List * attnos, List * values, List * flags,
58                                   int32 nkeys, float *idxPages, float *idxSelec);
59
60 extern Cost
61 join_selectivity(Oid functionObjectId, Oid operatorObjectId,
62                                  Oid relationObjectId1, AttrNumber attributeNumber1,
63                                  Oid relationObjectId2, AttrNumber attributeNumber2);
64
65 extern List    *find_inheritance_children(Oid inhparent);
66 extern List    *VersionGetParents(Oid verrelid);
67
68 #endif                                                  /* PLANCAT_H */