1/*-------------------------------------------------------------------------
2 *
3 * stratnum.h
4 * POSTGRES strategy number definitions.
5 *
6 *
7 * Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
9 *
10 * src/include/access/stratnum.h
11 *
12 *-------------------------------------------------------------------------
13 */
14#ifndef STRATNUM_H
15#define STRATNUM_H
16
17/*
18 * Strategy numbers identify the semantics that particular operators have
19 * with respect to particular operator classes. In some cases a strategy
20 * subtype (an OID) is used as further information.
21 */
22typedef uint16 StrategyNumber;
23
24#define InvalidStrategy ((StrategyNumber) 0)
25
26/*
27 * Strategy numbers for B-tree indexes.
28 */
29#define BTLessStrategyNumber 1
30#define BTLessEqualStrategyNumber 2
31#define BTEqualStrategyNumber 3
32#define BTGreaterEqualStrategyNumber 4
33#define BTGreaterStrategyNumber 5
34
35#define BTMaxStrategyNumber 5
36
37/*
38 * Strategy numbers for hash indexes. There's only one valid strategy for
39 * hashing: equality.
40 */
41#define HTEqualStrategyNumber 1
42
43#define HTMaxStrategyNumber 1
44
45/*
46 * Strategy numbers common to (some) GiST, SP-GiST and BRIN opclasses.
47 *
48 * The first few of these come from the R-Tree indexing method (hence the
49 * names); the others have been added over time as they have been needed.
50 */
51#define RTLeftStrategyNumber 1 /* for << */
52#define RTOverLeftStrategyNumber 2 /* for &< */
53#define RTOverlapStrategyNumber 3 /* for && */
54#define RTOverRightStrategyNumber 4 /* for &> */
55#define RTRightStrategyNumber 5 /* for >> */
56#define RTSameStrategyNumber 6 /* for ~= */
57#define RTContainsStrategyNumber 7 /* for @> */
58#define RTContainedByStrategyNumber 8 /* for <@ */
59#define RTOverBelowStrategyNumber 9 /* for &<| */
60#define RTBelowStrategyNumber 10 /* for <<| */
61#define RTAboveStrategyNumber 11 /* for |>> */
62#define RTOverAboveStrategyNumber 12 /* for |&> */
63#define RTOldContainsStrategyNumber 13 /* for old spelling of @> */
64#define RTOldContainedByStrategyNumber 14 /* for old spelling of <@ */
65#define RTKNNSearchStrategyNumber 15 /* for <-> (distance) */
66#define RTContainsElemStrategyNumber 16 /* for range types @> elem */
67#define RTAdjacentStrategyNumber 17 /* for -|- */
68#define RTEqualStrategyNumber 18 /* for = */
69#define RTNotEqualStrategyNumber 19 /* for != */
70#define RTLessStrategyNumber 20 /* for < */
71#define RTLessEqualStrategyNumber 21 /* for <= */
72#define RTGreaterStrategyNumber 22 /* for > */
73#define RTGreaterEqualStrategyNumber 23 /* for >= */
74#define RTSubStrategyNumber 24 /* for inet >> */
75#define RTSubEqualStrategyNumber 25 /* for inet <<= */
76#define RTSuperStrategyNumber 26 /* for inet << */
77#define RTSuperEqualStrategyNumber 27 /* for inet >>= */
78#define RTPrefixStrategyNumber 28 /* for text ^@ */
79
80#define RTMaxStrategyNumber 28
81
82
83#endif /* STRATNUM_H */
84