Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7528fd2

Browse files
committed
Add btree indexing of boolean values
Don Baccus
1 parentede72c2 commit7528fd2

File tree

8 files changed

+53
-10
lines changed

8 files changed

+53
-10
lines changed

‎src/backend/access/nbtree/nbtcompare.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.32 2000/01/28 17:23:47 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.33 2000/02/10 19:51:38 momjian Exp $
1212
*
1313
*NOTES
1414
*These functions are stored in pg_amproc. For each operator class
@@ -207,3 +207,9 @@ bttextcmp(struct varlena * a, struct varlena * b)
207207
else
208208
return1;
209209
}
210+
211+
int32
212+
btboolcmp(boola,boolb)
213+
{
214+
return (int32) ((uint8)a- (uint8)b);
215+
}

‎src/backend/utils/adt/bool.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/bool.c,v 1.21 2000/01/26 05:57:13 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/bool.c,v 1.22 2000/02/10 19:51:39 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -119,6 +119,18 @@ boolgt(bool arg1, bool arg2)
119119
returnarg1>arg2;
120120
}
121121

122+
bool
123+
boolle(boolarg1,boolarg2)
124+
{
125+
returnarg1 <=arg2;
126+
}
127+
128+
bool
129+
boolge(boolarg1,boolarg2)
130+
{
131+
returnarg1 >=arg2;
132+
}
133+
122134
bool
123135
istrue(boolarg1)
124136
{

‎src/include/catalog/pg_amop.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $Id: pg_amop.h,v 1.29 2000/01/26 05:57:56 momjian Exp $
11+
* $Id: pg_amop.h,v 1.30 2000/02/10 19:51:42 momjian Exp $
1212
*
1313
* NOTES
1414
* the genbki.sh script reads this file and generates .bki
@@ -344,6 +344,16 @@ DATA(insert OID = 0 ( 403 1768 1752 3 ));
344344
DATA(insertOID=0 (403176817574 ));
345345
DATA(insertOID=0 (403176817565 ));
346346

347+
/*
348+
*nbtree bool
349+
*/
350+
351+
DATA(insertOID=0 (4031690581 ));
352+
DATA(insertOID=0 (403169016942 ));
353+
DATA(insertOID=0 (4031690913 ));
354+
DATA(insertOID=0 (403169016954 ));
355+
DATA(insertOID=0 (4031690595 ));
356+
347357
/*
348358
*hash table _ops
349359
*/

‎src/include/catalog/pg_amproc.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
1111
* Portions Copyright (c) 1994, Regents of the University of California
1212
*
13-
* $Id: pg_amproc.h,v 1.19 2000/01/26 05:57:56 momjian Exp $
13+
* $Id: pg_amproc.h,v 1.20 2000/02/10 19:51:45 momjian Exp $
1414
*
1515
* NOTES
1616
* the genbki.sh script reads this file and generates .bki
@@ -99,6 +99,7 @@ DATA(insert OID = 0 (403 810 836 1));
9999
DATA(insertOID=0 (4039359261));
100100
DATA(insertOID=0 (4036529261));
101101
DATA(insertOID=0 (403176817691));
102+
DATA(insertOID=0 (403169016931));
102103

103104

104105
/* hash */

‎src/include/catalog/pg_opclass.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $Id: pg_opclass.h,v 1.27 2000/01/26 05:57:57 momjian Exp $
11+
* $Id: pg_opclass.h,v 1.28 2000/02/10 19:51:45 momjian Exp $
1212
*
1313
* NOTES
1414
* the genbki.sh script reads this file and generates .bki
@@ -118,5 +118,7 @@ DATA(insert OID = 652 (cidr_ops 650 ));
118118
DESCR("");
119119
DATA(insertOID=1768 (numeric_ops1700 ));
120120
DESCR("");
121+
DATA(insertOID=1690 (bool_ops16 ));
122+
DESCR("");
121123

122124
#endif/* PG_OPCLASS_H */

‎src/include/catalog/pg_operator.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $Id: pg_operator.h,v 1.66 2000/01/26 05:57:58 momjian Exp $
11+
* $Id: pg_operator.h,v 1.67 2000/02/10 19:51:45 momjian Exp $
1212
*
1313
* NOTES
1414
* the genbki.sh script reads this file and generates .bki
@@ -96,11 +96,13 @@ DATA(insert OID = 76 ( ">" PGUID 0 b t f 23 20 16 418 80 0 0 int48g
9696
DATA(insertOID=80 ("<="PGUID0btf2320164307600int48lescalarltselscalarltjoinsel ));
9797
DATA(insertOID=82 (">="PGUID0btf2320164203700int48gescalargtselscalargtjoinsel ));
9898

99-
DATA(insertOID=58 ("<"PGUID0btf16161659000boolltscalarltselscalarltjoinsel ));
100-
DATA(insertOID=59 (">"PGUID0btf16161658000boolgtscalargtselscalargtjoinsel ));
99+
DATA(insertOID=58 ("<"PGUID0btf16161659169500boolltscalarltselscalarltjoinsel ));
100+
DATA(insertOID=59 (">"PGUID0btf16161658169400boolgtscalargtselscalargtjoinsel ));
101101
DATA(insertOID=85 ("<>"PGUID0btf161616859100boolneneqselneqjoinsel ));
102102
DATA(insertOID=91 ("="PGUID0btt16161691855858booleqeqseleqjoinsel ));
103103
#defineBooleanEqualOperator 91
104+
DATA(insertOID=1694 ("<="PGUID0btf16161616955900boollescalarltselscalarltjoinsel ));
105+
DATA(insertOID=1695 (">="PGUID0btf16161616945800boolgescalargtselscalargtjoinsel ));
104106

105107
DATA(insertOID=92 ("="PGUID0btt18181692630631631chareqeqseleqjoinsel ));
106108
DATA(insertOID=93 ("="PGUID0btt19191693643660660nameeqeqseleqjoinsel ));

‎src/include/catalog/pg_proc.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: pg_proc.h,v 1.119 2000/01/31 14:02:27 wieck Exp $
10+
* $Id: pg_proc.h,v 1.120 2000/02/10 19:51:46 momjian Exp $
1111
*
1212
* NOTES
1313
* The script catalog/genbki.sh reads this file and generates .bki
@@ -2230,6 +2230,13 @@ DESCR("host address");
22302230
DATA(insertOID=683 (networkPGUID11ftt1f25"869"10000100network_network- ));
22312231
DESCR("network address");
22322232

2233+
DATA(insertOID=1691 (boollePGUID11ftt2f16"16 16"10000100boolle- ));
2234+
DESCR("less-than-or-equal");
2235+
DATA(insertOID=1692 (boolgePGUID11ftt2f16"16 16"10000100boolge- ));
2236+
DESCR("greater-than-or-equal");
2237+
DATA(insertOID=1693 (btboolcmpPGUID11ftt2f23"16 16"10000100btboolcmp- ));
2238+
DESCR("btree less-equal-greater");
2239+
22332240
/* OID's 1700 - 1799 NUMERIC data type */
22342241
DATA(insertOID=1701 (numeric_inPGUID11ftt3f1700"0 0 23"10000100numeric_in- ));
22352242
DESCR("(internal)");

‎src/include/utils/builtins.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: builtins.h,v 1.99 2000/01/26 05:58:37 momjian Exp $
10+
* $Id: builtins.h,v 1.100 2000/02/10 19:51:52 momjian Exp $
1111
*
1212
* NOTES
1313
* This should normally only be included by fmgr.h.
@@ -44,6 +44,8 @@ extern bool booleq(bool arg1, bool arg2);
4444
externboolboolne(boolarg1,boolarg2);
4545
externboolboollt(boolarg1,boolarg2);
4646
externboolboolgt(boolarg1,boolarg2);
47+
externboolboolle(boolarg1,boolarg2);
48+
externboolboolge(boolarg1,boolarg2);
4749
externboolistrue(boolarg1);
4850
externboolisfalse(boolarg1);
4951

@@ -181,6 +183,7 @@ extern int32 btabstimecmp(AbsoluteTime a, AbsoluteTime b);
181183
externint32btcharcmp(chara,charb);
182184
externint32btnamecmp(NameData*a,NameData*b);
183185
externint32bttextcmp(structvarlena*a,structvarlena*b);
186+
externint32btboolcmp(boola,boolb);
184187

185188
/* support routines for the rtree access method, by opclass */
186189
externBOX*rt_box_union(BOX*a,BOX*b);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp