1 /*-------------------------------------------------------------------------
4 * index strategy type definitions
5 * (separated out from original istrat.h to avoid circular refs)
8 * Copyright (c) 1994, Regents of the University of California
10 * $Id: strat.h,v 1.14 1999/05/25 22:04:56 momjian Exp $
12 *-------------------------------------------------------------------------
17 #include <access/skey.h>
19 typedef uint16 StrategyNumber;
21 #define InvalidStrategy 0
23 typedef struct StrategyTransformMapData
25 StrategyNumber strategy[1]; /* VARIABLE LENGTH ARRAY */
26 } StrategyTransformMapData; /* VARIABLE LENGTH
38 typedef StrategyTransformMapData *StrategyTransformMap;
40 typedef struct StrategyOperatorData
42 StrategyNumber strategy;
43 bits16 flags; /* scan qualification flags h/skey.h */
44 } StrategyOperatorData;
46 typedef StrategyOperatorData *StrategyOperator;
48 typedef struct StrategyTermData
49 { /* conjunctive term */
51 StrategyOperatorData operatorData[1]; /* VARIABLE LENGTH */
52 } StrategyTermData; /* VARIABLE LENGTH STRUCTURE */
54 typedef StrategyTermData *StrategyTerm;
56 typedef struct StrategyExpressionData
57 { /* disjunctive normal form */
58 StrategyTerm term[1]; /* VARIABLE LENGTH ARRAY */
59 } StrategyExpressionData; /* VARIABLE LENGTH STRUCTURE */
61 typedef StrategyExpressionData *StrategyExpression;
63 typedef struct StrategyEvaluationData
65 StrategyNumber maxStrategy;
66 StrategyTransformMap negateTransform;
67 StrategyTransformMap commuteTransform;
68 StrategyTransformMap negateCommuteTransform;
69 StrategyExpression expression[12]; /* XXX VARIABLE LENGTH */
70 } StrategyEvaluationData; /* VARIABLE LENGTH STRUCTURE */
72 typedef StrategyEvaluationData *StrategyEvaluation;
75 * StrategyTransformMapIsValid
76 * Returns true iff strategy transformation map is valid.
78 #define StrategyTransformMapIsValid(transform) PointerIsValid(transform)
81 #define AMStrategies(foo) (foo)
83 typedef struct StrategyMapData
85 ScanKeyData entry[1]; /* VARIABLE LENGTH ARRAY */
86 } StrategyMapData; /* VARIABLE LENGTH STRUCTURE */
88 typedef StrategyMapData *StrategyMap;
90 typedef struct IndexStrategyData
92 StrategyMapData strategyMapData[1]; /* VARIABLE LENGTH ARRAY */
93 } IndexStrategyData; /* VARIABLE LENGTH STRUCTURE */
95 typedef IndexStrategyData *IndexStrategy;