Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
14b0da2a
Commit
14b0da2a
authored
23 years ago
by
Tom Lane
Browse files
Options
Downloads
Patches
Plain Diff
Changes:
1. gist__int_ops is now without lossy 2. added sort entry in picksplit Oleg Bartunov
parent
5798ccc4
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
contrib/intarray/README.intarray
+3
-0
3 additions, 0 deletions
contrib/intarray/README.intarray
contrib/intarray/_int.c
+146
-192
146 additions, 192 deletions
contrib/intarray/_int.c
contrib/intarray/_int.sql.in
+6
-6
6 additions, 6 deletions
contrib/intarray/_int.sql.in
with
155 additions
and
198 deletions
contrib/intarray/README.intarray
+
3
−
0
View file @
14b0da2a
...
@@ -12,6 +12,9 @@ for additional information.
...
@@ -12,6 +12,9 @@ for additional information.
CHANGES:
CHANGES:
September 28, 2001
1. gist__int_ops now is without lossy
2. add sort entry in picksplit
September 21, 2001
September 21, 2001
1. Added support for boolean query (indexable operator @@, looks like
1. Added support for boolean query (indexable operator @@, looks like
a @@ '1|(2&3)', perfomance is better in any case )
a @@ '1|(2&3)', perfomance is better in any case )
...
...
This diff is collapsed.
Click to expand it.
contrib/intarray/_int.c
+
146
−
192
View file @
14b0da2a
...
@@ -33,12 +33,18 @@
...
@@ -33,12 +33,18 @@
/* dimension of array */
/* dimension of array */
#define NDIM 1
#define NDIM 1
/*
* flags for gist__int_ops, use ArrayType->flags
* which is unused (see array.h)
*/
#define LEAFKEY (1<<31)
#define ISLEAFKEY(x) ( ((ArrayType*)(x))->flags & LEAFKEY )
/* useful macros for accessing int4 arrays */
/* useful macros for accessing int4 arrays */
#define ARRPTR(x) ( (int4 *) ARR_DATA_PTR(x) )
#define ARRPTR(x) ( (int4 *) ARR_DATA_PTR(x) )
#define ARRNELEMS(x) ArrayGetNItems( ARR_NDIM(x), ARR_DIMS(x))
#define ARRNELEMS(x) ArrayGetNItems( ARR_NDIM(x), ARR_DIMS(x))
#define ARRISNULL(x) ( (x) ? ( ( ARR_NDIM(x) == NDIM ) ? ( ( ARRNELEMS( x ) ) ? 0 : 1 ) : ( ( ARR_NDIM(x) ) ? (elog(ERROR,"Array is not one-dimensional: %d dimensions", ARR_NDIM(x)),1) : 1 ) ) : 1 )
#define ARRISVOID(x) ( (x) ? ( ( ARR_NDIM(x) == NDIM ) ? ( ( ARRNELEMS( x ) ) ? 0 : 1 ) : ( ( ARR_NDIM(x) ) ? (elog(ERROR,"Array is not one-dimensional: %d dimensions",ARRNELEMS( x )),1) : 0 ) ) : 0 )
#define ARRISVOID(x) ( (x) ? ( ( ARR_NDIM(x) == NDIM ) ? ( ( ARRNELEMS( x ) ) ? 0 : 1 ) : 1 ) : 0 )
#define SORT(x) \
#define SORT(x) \
do { \
do { \
...
@@ -81,11 +87,11 @@ typedef char *BITVECP;
...
@@ -81,11 +87,11 @@ typedef char *BITVECP;
/* beware of multiple evaluation of arguments to these macros! */
/* beware of multiple evaluation of arguments to these macros! */
#define GETBYTE(x,i) ( *( (BITVECP)(x) + (int)( (i) / BITBYTE ) ) )
#define GETBYTE(x,i) ( *( (BITVECP)(x) + (int)( (i) / BITBYTE ) ) )
#define GETBITBYTE(x,i) ( *((char*)
x
) >>
i
& 0x01 )
#define GETBITBYTE(x,i) (
(
*((char*)
(x)
) >>
(i))
& 0x01 )
#define CLRBIT(x,i) GETBYTE(x,i) &= ~( 0x01 << ( (i) % BITBYTE ) )
#define CLRBIT(x,i) GETBYTE(x,i) &= ~( 0x01 << ( (i) % BITBYTE ) )
#define SETBIT(x,i) GETBYTE(x,i) |= ( 0x01 << ( (i) % BITBYTE ) )
#define SETBIT(x,i) GETBYTE(x,i) |= ( 0x01 << ( (i) % BITBYTE ) )
#define GETBIT(x,i) ( (GETBYTE(x,i) >> ( (i) % BITBYTE )) & 0x01 )
#define GETBIT(x,i) ( (GETBYTE(x,i) >> ( (i) % BITBYTE )) & 0x01 )
#define HASHVAL(val) ((val) % SIGLENBIT)
#define HASHVAL(val) ((
(unsigned int)(
val)
)
% SIGLENBIT)
#define HASH(sign, val) SETBIT((sign), HASHVAL(val))
#define HASH(sign, val) SETBIT((sign), HASHVAL(val))
...
@@ -290,12 +296,11 @@ g_int_consistent(PG_FUNCTION_ARGS) {
...
@@ -290,12 +296,11 @@ g_int_consistent(PG_FUNCTION_ARGS) {
if
(
strategy
==
BooleanSearchStrategy
)
if
(
strategy
==
BooleanSearchStrategy
)
PG_RETURN_BOOL
(
execconsistent
(
(
QUERYTYPE
*
)
query
,
PG_RETURN_BOOL
(
execconsistent
(
(
QUERYTYPE
*
)
query
,
(
ArrayType
*
)
DatumGetPointer
(
entry
->
key
),
(
ArrayType
*
)
DatumGetPointer
(
entry
->
key
),
(
ARRNELEMS
(
DatumGetPointer
(
entry
->
key
))
<
2
*
MAXNUMRANGE
)
?
ISLEAFKEY
(
(
ArrayType
*
)
DatumGetPointer
(
entry
->
key
)
)
)
);
GIST_LEAF
(
entry
)
:
false
)
);
/* sort query for fast search, key is already sorted */
/* XXX are we sure it's safe to scribble on the query object here? */
/* XXX are we sure it's safe to scribble on the query object here? */
/* XXX what about toasted input? */
/* XXX what about toasted input? */
/* sort query for fast search, key is already sorted */
if
(
ARRISVOID
(
query
)
)
if
(
ARRISVOID
(
query
)
)
PG_RETURN_BOOL
(
false
);
PG_RETURN_BOOL
(
false
);
PREPAREARR
(
query
);
PREPAREARR
(
query
);
...
@@ -312,6 +317,10 @@ g_int_consistent(PG_FUNCTION_ARGS) {
...
@@ -312,6 +317,10 @@ g_int_consistent(PG_FUNCTION_ARGS) {
query
);
query
);
break
;
break
;
case
RTContainedByStrategyNumber
:
case
RTContainedByStrategyNumber
:
if
(
GIST_LEAF
(
entry
)
)
retval
=
inner_int_contains
(
query
,
(
ArrayType
*
)
DatumGetPointer
(
entry
->
key
)
);
else
retval
=
inner_int_overlap
((
ArrayType
*
)
DatumGetPointer
(
entry
->
key
),
retval
=
inner_int_overlap
((
ArrayType
*
)
DatumGetPointer
(
entry
->
key
),
query
);
query
);
break
;
break
;
...
@@ -346,38 +355,27 @@ g_int_compress(PG_FUNCTION_ARGS)
...
@@ -346,38 +355,27 @@ g_int_compress(PG_FUNCTION_ARGS)
min
,
min
,
cand
;
cand
;
retval
=
palloc
(
sizeof
(
GISTENTRY
));
if
(
entry
->
leafkey
)
{
if
(
DatumGetPointer
(
entry
->
key
)
!=
NULL
)
r
=
(
ArrayType
*
)
PG_DETOAST_DATUM_COPY
(
entry
->
key
);
r
=
(
ArrayType
*
)
PG_DETOAST_DATUM_COPY
(
entry
->
key
);
else
PREPAREARR
(
r
);
r
=
NULL
;
r
->
flags
|=
LEAFKEY
;
retval
=
palloc
(
sizeof
(
GISTENTRY
));
if
(
ARRISNULL
(
r
))
gistentryinit
(
*
retval
,
PointerGetDatum
(
r
),
{
entry
->
rel
,
entry
->
page
,
entry
->
offset
,
VARSIZE
(
r
),
FALSE
);
if
(
ARRISVOID
(
r
)
)
{
ArrayType
*
out
=
new_intArrayType
(
0
);
gistentryinit
(
*
retval
,
PointerGetDatum
(
out
),
entry
->
rel
,
entry
->
page
,
entry
->
offset
,
VARSIZE
(
out
),
FALSE
);
}
else
{
gistentryinit
(
*
retval
,
(
Datum
)
0
,
entry
->
rel
,
entry
->
page
,
entry
->
offset
,
0
,
FALSE
);
}
if
(
r
)
pfree
(
r
);
PG_RETURN_POINTER
(
retval
);
PG_RETURN_POINTER
(
retval
);
}
}
if
(
entry
->
leafkey
)
r
=
(
ArrayType
*
)
PG_DETOAST_DATUM
(
entry
->
key
);
PREPAREARR
(
r
);
if
(
ISLEAFKEY
(
r
)
||
ARRISVOID
(
r
)
)
{
len
=
ARRNELEMS
(
r
);
if
(
r
!=
(
ArrayType
*
)
DatumGetPointer
(
entry
->
key
)
)
pfree
(
r
);
#ifdef GIST_DEBUG
PG_RETURN_POINTER
(
entry
);
elog
(
NOTICE
,
"COMP IN: %d leaf; %d rel; %d page; %d offset; %d bytes; %d elems"
,
entry
->
leafkey
,
(
int
)
entry
->
rel
,
(
int
)
entry
->
page
,
(
int
)
entry
->
offset
,
(
int
)
entry
->
bytes
,
len
);
}
#endif
if
(
len
>=
2
*
MAXNUMRANGE
)
if
(
(
len
=
ARRNELEMS
(
r
))
>=
2
*
MAXNUMRANGE
)
{
/* compress */
{
/* compress */
if
(
r
==
(
ArrayType
*
)
DatumGetPointer
(
entry
->
key
)
)
r
=
(
ArrayType
*
)
PG_DETOAST_DATUM_COPY
(
entry
->
key
);
r
=
resize_intArrayType
(
r
,
2
*
(
len
));
r
=
resize_intArrayType
(
r
,
2
*
(
len
));
dr
=
ARRPTR
(
r
);
dr
=
ARRPTR
(
r
);
...
@@ -400,12 +398,15 @@ g_int_compress(PG_FUNCTION_ARGS)
...
@@ -400,12 +398,15 @@ g_int_compress(PG_FUNCTION_ARGS)
len
-=
2
;
len
-=
2
;
}
}
r
=
resize_intArrayType
(
r
,
len
);
r
=
resize_intArrayType
(
r
,
len
);
}
retval
=
palloc
(
sizeof
(
GISTENTRY
));
gistentryinit
(
*
retval
,
PointerGetDatum
(
r
),
gistentryinit
(
*
retval
,
PointerGetDatum
(
r
),
entry
->
rel
,
entry
->
page
,
entry
->
offset
,
VARSIZE
(
r
),
FALSE
);
entry
->
rel
,
entry
->
page
,
entry
->
offset
,
VARSIZE
(
r
),
FALSE
);
PG_RETURN_POINTER
(
retval
);
PG_RETURN_POINTER
(
retval
);
}
else
{
PG_RETURN_POINTER
(
entry
);
}
PG_RETURN_POINTER
(
entry
);
}
}
Datum
Datum
...
@@ -422,46 +423,26 @@ g_int_decompress(PG_FUNCTION_ARGS)
...
@@ -422,46 +423,26 @@ g_int_decompress(PG_FUNCTION_ARGS)
int
i
,
int
i
,
j
;
j
;
if
(
DatumGetPointer
(
entry
->
key
)
!=
NULL
)
in
=
(
ArrayType
*
)
PG_DETOAST_DATUM
(
entry
->
key
);
in
=
(
ArrayType
*
)
PG_DETOAST_DATUM
(
entry
->
key
);
else
in
=
NULL
;
if
(
ARRISNULL
(
in
))
{
retval
=
palloc
(
sizeof
(
GISTENTRY
));
if
(
ARRISVOID
(
in
)
)
{
if
(
ARRISVOID
(
in
)
)
{
r
=
new_intArrayType
(
0
);
PG_RETURN_POINTER
(
entry
);
gistentryinit
(
*
retval
,
PointerGetDatum
(
r
),
entry
->
rel
,
entry
->
page
,
entry
->
offset
,
VARSIZE
(
r
),
FALSE
);
}
else
{
gistentryinit
(
*
retval
,
(
Datum
)
0
,
entry
->
rel
,
entry
->
page
,
entry
->
offset
,
0
,
FALSE
);
}
if
(
in
)
if
(
in
!=
(
ArrayType
*
)
DatumGetPointer
(
entry
->
key
))
pfree
(
in
);
#ifdef GIST_DEBUG
elog
(
NOTICE
,
"DECOMP IN: NULL"
);
#endif
PG_RETURN_POINTER
(
retval
);
}
}
lenin
=
ARRNELEMS
(
in
);
lenin
=
ARRNELEMS
(
in
);
din
=
ARRPTR
(
in
);
if
(
lenin
<
2
*
MAXNUMRANGE
)
if
(
lenin
<
2
*
MAXNUMRANGE
||
ISLEAFKEY
(
in
)
)
{
/* not comressed value */
{
/* not comressed value */
if
(
in
!=
(
ArrayType
*
)
DatumGetPointer
(
entry
->
key
))
{
/* sometimes strange bytesize */
retval
=
palloc
(
sizeof
(
GISTENTRY
));
gistentryinit
(
*
entry
,
PointerGetDatum
(
in
),
entry
->
rel
,
entry
->
page
,
entry
->
offset
,
VARSIZE
(
in
),
FALSE
);
gistentryinit
(
*
retval
,
PointerGetDatum
(
in
),
entry
->
rel
,
entry
->
page
,
entry
->
offset
,
VARSIZE
(
in
),
FALSE
);
PG_RETURN_POINTER
(
retval
);
}
PG_RETURN_POINTER
(
entry
);
PG_RETURN_POINTER
(
entry
);
}
}
#ifdef GIST_DEBUG
din
=
ARRPTR
(
in
);
elog
(
NOTICE
,
"DECOMP IN: %d leaf; %d rel; %d page; %d offset; %d bytes; %d elems"
,
entry
->
leafkey
,
(
int
)
entry
->
rel
,
(
int
)
entry
->
page
,
(
int
)
entry
->
offset
,
(
int
)
entry
->
bytes
,
lenin
);
#endif
lenr
=
internal_size
(
din
,
lenin
);
lenr
=
internal_size
(
din
,
lenin
);
r
=
new_intArrayType
(
lenr
);
r
=
new_intArrayType
(
lenr
);
...
@@ -475,8 +456,8 @@ g_int_decompress(PG_FUNCTION_ARGS)
...
@@ -475,8 +456,8 @@ g_int_decompress(PG_FUNCTION_ARGS)
if
(
in
!=
(
ArrayType
*
)
DatumGetPointer
(
entry
->
key
))
if
(
in
!=
(
ArrayType
*
)
DatumGetPointer
(
entry
->
key
))
pfree
(
in
);
pfree
(
in
);
retval
=
palloc
(
sizeof
(
GISTENTRY
));
retval
=
palloc
(
sizeof
(
GISTENTRY
));
gistentryinit
(
*
retval
,
PointerGetDatum
(
r
),
gistentryinit
(
*
retval
,
PointerGetDatum
(
r
),
entry
->
rel
,
entry
->
page
,
entry
->
offset
,
VARSIZE
(
r
),
FALSE
);
entry
->
rel
,
entry
->
page
,
entry
->
offset
,
VARSIZE
(
r
),
FALSE
);
PG_RETURN_POINTER
(
retval
);
PG_RETURN_POINTER
(
retval
);
}
}
...
@@ -505,7 +486,7 @@ g_int_picksplit(PG_FUNCTION_ARGS)
...
@@ -505,7 +486,7 @@ g_int_picksplit(PG_FUNCTION_ARGS)
inner_int_union
,
inner_int_union
,
inner_int_inter
,
inner_int_inter
,
rt__int_size
,
rt__int_size
,
1e-8
0
.
01
)
);
)
);
}
}
...
@@ -558,12 +539,11 @@ _int_contains(PG_FUNCTION_ARGS)
...
@@ -558,12 +539,11 @@ _int_contains(PG_FUNCTION_ARGS)
ArrayType
*
b
=
(
ArrayType
*
)
DatumGetPointer
(
PG_DETOAST_DATUM_COPY
(
PG_GETARG_DATUM
(
1
)));
ArrayType
*
b
=
(
ArrayType
*
)
DatumGetPointer
(
PG_DETOAST_DATUM_COPY
(
PG_GETARG_DATUM
(
1
)));
bool
res
;
bool
res
;
if
(
ARRIS
NULL
(
a
)
||
ARRIS
NULL
(
b
))
if
(
ARRIS
VOID
(
a
)
||
ARRIS
VOID
(
b
))
return
FALSE
;
return
FALSE
;
PREPAREARR
(
a
);
PREPAREARR
(
a
);
PREPAREARR
(
b
);
PREPAREARR
(
b
);
res
=
inner_int_contains
(
a
,
b
);
res
=
inner_int_contains
(
a
,
b
);
pfree
(
a
);
pfree
(
a
);
pfree
(
b
);
pfree
(
b
);
...
@@ -581,7 +561,7 @@ inner_int_contains(ArrayType *a, ArrayType *b)
...
@@ -581,7 +561,7 @@ inner_int_contains(ArrayType *a, ArrayType *b)
int
*
da
,
int
*
da
,
*
db
;
*
db
;
if
(
ARRIS
NULL
(
a
)
||
ARRIS
NULL
(
b
))
if
(
ARRIS
VOID
(
a
)
||
ARRIS
VOID
(
b
))
return
FALSE
;
return
FALSE
;
na
=
ARRNELEMS
(
a
);
na
=
ARRNELEMS
(
a
);
...
@@ -636,11 +616,11 @@ _int_same(PG_FUNCTION_ARGS)
...
@@ -636,11 +616,11 @@ _int_same(PG_FUNCTION_ARGS)
int
*
da
,
int
*
da
,
*
db
;
*
db
;
bool
result
;
bool
result
;
bool
a
null
=
ARRIS
NULL
(
a
);
bool
a
void
=
ARRIS
VOID
(
a
);
bool
b
null
=
ARRIS
NULL
(
b
);
bool
b
void
=
ARRIS
VOID
(
b
);
if
(
a
null
||
b
null
)
if
(
a
void
||
b
void
)
return
(
a
null
&&
b
null
)
?
TRUE
:
FALSE
;
return
(
a
void
&&
b
void
)
?
TRUE
:
FALSE
;
SORT
(
a
);
SORT
(
a
);
SORT
(
b
);
SORT
(
b
);
...
@@ -677,7 +657,7 @@ _int_overlap(PG_FUNCTION_ARGS)
...
@@ -677,7 +657,7 @@ _int_overlap(PG_FUNCTION_ARGS)
ArrayType
*
b
=
(
ArrayType
*
)
DatumGetPointer
(
PG_DETOAST_DATUM_COPY
(
PG_GETARG_DATUM
(
1
)));
ArrayType
*
b
=
(
ArrayType
*
)
DatumGetPointer
(
PG_DETOAST_DATUM_COPY
(
PG_GETARG_DATUM
(
1
)));
bool
result
;
bool
result
;
if
(
ARRIS
NULL
(
a
)
||
ARRIS
NULL
(
b
))
if
(
ARRIS
VOID
(
a
)
||
ARRIS
VOID
(
b
))
return
FALSE
;
return
FALSE
;
SORT
(
a
);
SORT
(
a
);
...
@@ -701,7 +681,7 @@ inner_int_overlap(ArrayType *a, ArrayType *b)
...
@@ -701,7 +681,7 @@ inner_int_overlap(ArrayType *a, ArrayType *b)
int
*
da
,
int
*
da
,
*
db
;
*
db
;
if
(
ARRIS
NULL
(
a
)
||
ARRIS
NULL
(
b
))
if
(
ARRIS
VOID
(
a
)
||
ARRIS
VOID
(
b
))
return
FALSE
;
return
FALSE
;
na
=
ARRNELEMS
(
a
);
na
=
ARRNELEMS
(
a
);
...
@@ -732,9 +712,9 @@ _int_union(PG_FUNCTION_ARGS)
...
@@ -732,9 +712,9 @@ _int_union(PG_FUNCTION_ARGS)
ArrayType
*
b
=
(
ArrayType
*
)
DatumGetPointer
(
PG_DETOAST_DATUM_COPY
(
PG_GETARG_DATUM
(
1
)));
ArrayType
*
b
=
(
ArrayType
*
)
DatumGetPointer
(
PG_DETOAST_DATUM_COPY
(
PG_GETARG_DATUM
(
1
)));
ArrayType
*
result
;
ArrayType
*
result
;
if
(
!
ARRIS
NULL
(
a
))
if
(
!
ARRIS
VOID
(
a
))
SORT
(
a
);
SORT
(
a
);
if
(
!
ARRIS
NULL
(
b
))
if
(
!
ARRIS
VOID
(
b
))
SORT
(
b
);
SORT
(
b
);
result
=
inner_int_union
(
a
,
b
);
result
=
inner_int_union
(
a
,
b
);
...
@@ -759,15 +739,11 @@ inner_int_union(ArrayType *a, ArrayType *b)
...
@@ -759,15 +739,11 @@ inner_int_union(ArrayType *a, ArrayType *b)
int
i
,
int
i
,
j
;
j
;
#ifdef GIST_DEBUG
if
(
ARRISVOID
(
a
)
&&
ARRISVOID
(
b
))
elog
(
NOTICE
,
"inner_union %d %d"
,
ARRISNULL
(
a
),
ARRISNULL
(
b
));
#endif
if
(
ARRISNULL
(
a
)
&&
ARRISNULL
(
b
))
return
new_intArrayType
(
0
);
return
new_intArrayType
(
0
);
if
(
ARRIS
NULL
(
a
))
if
(
ARRIS
VOID
(
a
))
r
=
copy_intArrayType
(
b
);
r
=
copy_intArrayType
(
b
);
if
(
ARRIS
NULL
(
b
))
if
(
ARRIS
VOID
(
b
))
r
=
copy_intArrayType
(
a
);
r
=
copy_intArrayType
(
a
);
if
(
r
)
if
(
r
)
...
@@ -811,7 +787,7 @@ _int_inter(PG_FUNCTION_ARGS)
...
@@ -811,7 +787,7 @@ _int_inter(PG_FUNCTION_ARGS)
ArrayType
*
b
=
(
ArrayType
*
)
DatumGetPointer
(
PG_DETOAST_DATUM_COPY
(
PG_GETARG_DATUM
(
1
)));
ArrayType
*
b
=
(
ArrayType
*
)
DatumGetPointer
(
PG_DETOAST_DATUM_COPY
(
PG_GETARG_DATUM
(
1
)));
ArrayType
*
result
;
ArrayType
*
result
;
if
(
ARRIS
NULL
(
a
)
||
ARRIS
NULL
(
b
))
if
(
ARRIS
VOID
(
a
)
||
ARRIS
VOID
(
b
))
PG_RETURN_POINTER
(
new_intArrayType
(
0
));
PG_RETURN_POINTER
(
new_intArrayType
(
0
));
SORT
(
a
);
SORT
(
a
);
...
@@ -837,11 +813,7 @@ inner_int_inter(ArrayType *a, ArrayType *b)
...
@@ -837,11 +813,7 @@ inner_int_inter(ArrayType *a, ArrayType *b)
int
i
,
int
i
,
j
;
j
;
#ifdef GIST_DEBUG
if
(
ARRISVOID
(
a
)
||
ARRISVOID
(
b
))
elog
(
NOTICE
,
"inner_inter %d %d"
,
ARRISNULL
(
a
),
ARRISNULL
(
b
));
#endif
if
(
ARRISNULL
(
a
)
||
ARRISNULL
(
b
))
return
new_intArrayType
(
0
);
return
new_intArrayType
(
0
);
na
=
ARRNELEMS
(
a
);
na
=
ARRNELEMS
(
a
);
...
@@ -877,9 +849,6 @@ inner_int_inter(ArrayType *a, ArrayType *b)
...
@@ -877,9 +849,6 @@ inner_int_inter(ArrayType *a, ArrayType *b)
static
void
static
void
rt__int_size
(
ArrayType
*
a
,
float
*
size
)
rt__int_size
(
ArrayType
*
a
,
float
*
size
)
{
{
if
(
ARRISNULL
(
a
))
*
size
=
0
.
0
;
else
*
size
=
(
float
)
ARRNELEMS
(
a
);
*
size
=
(
float
)
ARRNELEMS
(
a
);
return
;
return
;
...
@@ -933,6 +902,7 @@ new_intArrayType(int num)
...
@@ -933,6 +902,7 @@ new_intArrayType(int num)
MemSet
(
r
,
0
,
nbytes
);
MemSet
(
r
,
0
,
nbytes
);
r
->
size
=
nbytes
;
r
->
size
=
nbytes
;
r
->
ndim
=
NDIM
;
r
->
ndim
=
NDIM
;
r
->
flags
&=
~
LEAFKEY
;
*
((
int
*
)
ARR_DIMS
(
r
))
=
num
;
*
((
int
*
)
ARR_DIMS
(
r
))
=
num
;
*
((
int
*
)
ARR_LBOUND
(
r
))
=
1
;
*
((
int
*
)
ARR_LBOUND
(
r
))
=
1
;
...
@@ -959,8 +929,6 @@ copy_intArrayType(ArrayType *a)
...
@@ -959,8 +929,6 @@ copy_intArrayType(ArrayType *a)
{
{
ArrayType
*
r
;
ArrayType
*
r
;
if
(
ARRISNULL
(
a
))
return
NULL
;
r
=
new_intArrayType
(
ARRNELEMS
(
a
));
r
=
new_intArrayType
(
ARRNELEMS
(
a
));
memmove
(
r
,
a
,
VARSIZE
(
a
));
memmove
(
r
,
a
,
VARSIZE
(
a
));
return
r
;
return
r
;
...
@@ -1021,8 +989,6 @@ _intbig_overlap(ArrayType *a, ArrayType *b)
...
@@ -1021,8 +989,6 @@ _intbig_overlap(ArrayType *a, ArrayType *b)
BITVECP
da
,
BITVECP
da
,
db
;
db
;
if
(
ARRISNULL
(
a
)
||
ARRISNULL
(
b
))
return
FALSE
;
da
=
SIGPTR
(
a
);
da
=
SIGPTR
(
a
);
db
=
SIGPTR
(
b
);
db
=
SIGPTR
(
b
);
...
@@ -1037,8 +1003,6 @@ _intbig_contains(ArrayType *a, ArrayType *b)
...
@@ -1037,8 +1003,6 @@ _intbig_contains(ArrayType *a, ArrayType *b)
BITVECP
da
,
BITVECP
da
,
db
;
db
;
if
(
ARRISNULL
(
a
)
||
ARRISNULL
(
b
))
return
FALSE
;
da
=
SIGPTR
(
a
);
da
=
SIGPTR
(
a
);
db
=
SIGPTR
(
b
);
db
=
SIGPTR
(
b
);
...
@@ -1052,15 +1016,7 @@ rt__intbig_size(ArrayType *a, float *sz)
...
@@ -1052,15 +1016,7 @@ rt__intbig_size(ArrayType *a, float *sz)
{
{
int
i
,
int
i
,
len
=
0
;
len
=
0
;
BITVECP
bv
;
BITVECP
bv
=
SIGPTR
(
a
);
if
(
ARRISNULL
(
a
))
{
*
sz
=
0
.
0
;
return
;
}
bv
=
SIGPTR
(
a
);
LOOPBYTE
(
LOOPBYTE
(
len
+=
len
+=
...
@@ -1088,13 +1044,6 @@ _intbig_union(ArrayType *a, ArrayType *b)
...
@@ -1088,13 +1044,6 @@ _intbig_union(ArrayType *a, ArrayType *b)
dr
;
dr
;
int
i
;
int
i
;
if
(
ARRISNULL
(
a
)
&&
ARRISNULL
(
b
))
return
new_intArrayType
(
0
);
if
(
ARRISNULL
(
a
))
return
copy_intArrayType
(
b
);
if
(
ARRISNULL
(
b
))
return
copy_intArrayType
(
a
);
r
=
new_intArrayType
(
SIGLENINT
);
r
=
new_intArrayType
(
SIGLENINT
);
da
=
SIGPTR
(
a
);
da
=
SIGPTR
(
a
);
...
@@ -1115,9 +1064,6 @@ _intbig_inter(ArrayType *a, ArrayType *b)
...
@@ -1115,9 +1064,6 @@ _intbig_inter(ArrayType *a, ArrayType *b)
dr
;
dr
;
int
i
;
int
i
;
if
(
ARRISNULL
(
a
)
||
ARRISNULL
(
b
))
return
new_intArrayType
(
0
);
r
=
new_intArrayType
(
SIGLENINT
);
r
=
new_intArrayType
(
SIGLENINT
);
da
=
SIGPTR
(
a
);
da
=
SIGPTR
(
a
);
...
@@ -1139,12 +1085,6 @@ g_intbig_same(PG_FUNCTION_ARGS)
...
@@ -1139,12 +1085,6 @@ g_intbig_same(PG_FUNCTION_ARGS)
db
;
db
;
int
i
;
int
i
;
if
(
ARRISNULL
(
a
)
||
ARRISNULL
(
b
))
{
*
result
=
(
ARRISNULL
(
a
)
&&
ARRISNULL
(
b
))
?
TRUE
:
FALSE
;
PG_RETURN_POINTER
(
result
);
}
da
=
SIGPTR
(
a
);
da
=
SIGPTR
(
a
);
db
=
SIGPTR
(
b
);
db
=
SIGPTR
(
b
);
...
@@ -1176,7 +1116,6 @@ g_intbig_compress(PG_FUNCTION_ARGS)
...
@@ -1176,7 +1116,6 @@ g_intbig_compress(PG_FUNCTION_ARGS)
in
=
NULL
;
in
=
NULL
;
if
(
!
entry
->
leafkey
)
{
if
(
!
entry
->
leafkey
)
{
if
(
!
ARRISNULL
(
in
)
)
{
LOOPBYTE
(
LOOPBYTE
(
if
(
(
((
char
*
)
ARRPTR
(
in
))[
i
]
&
0xff
)
!=
0xff
)
{
if
(
(
((
char
*
)
ARRPTR
(
in
))[
i
]
&
0xff
)
!=
0xff
)
{
maycompress
=
false
;
maycompress
=
false
;
...
@@ -1186,32 +1125,25 @@ g_intbig_compress(PG_FUNCTION_ARGS)
...
@@ -1186,32 +1125,25 @@ g_intbig_compress(PG_FUNCTION_ARGS)
if
(
maycompress
)
{
if
(
maycompress
)
{
retval
=
palloc
(
sizeof
(
GISTENTRY
));
retval
=
palloc
(
sizeof
(
GISTENTRY
));
r
=
new_intArrayType
(
1
);
r
=
new_intArrayType
(
1
);
gistentryinit
(
*
retval
,
PointerGetDatum
(
r
),
entry
->
rel
,
entry
->
page
,
entry
->
offset
,
VARSIZE
(
r
),
FALSE
);
gistentryinit
(
*
retval
,
PointerGetDatum
(
r
),
entry
->
rel
,
entry
->
page
,
entry
->
offset
,
VARSIZE
(
r
),
FALSE
);
PG_RETURN_POINTER
(
retval
);
PG_RETURN_POINTER
(
retval
);
}
}
}
PG_RETURN_POINTER
(
entry
);
PG_RETURN_POINTER
(
entry
);
}
}
retval
=
palloc
(
sizeof
(
GISTENTRY
));
retval
=
palloc
(
sizeof
(
GISTENTRY
));
r
=
new_intArrayType
(
SIGLENINT
);
if
(
ARRIS
NULL
(
in
))
if
(
ARRIS
VOID
(
in
))
{
{
if
(
ARRISVOID
(
in
)
)
{
r
=
new_intArrayType
(
SIGLENINT
);
gistentryinit
(
*
retval
,
PointerGetDatum
(
r
),
gistentryinit
(
*
retval
,
PointerGetDatum
(
r
),
entry
->
rel
,
entry
->
page
,
entry
->
offset
,
VARSIZE
(
r
),
FALSE
);
entry
->
rel
,
entry
->
page
,
entry
->
offset
,
VARSIZE
(
r
),
FALSE
);
}
else
{
gistentryinit
(
*
retval
,
(
Datum
)
0
,
entry
->
rel
,
entry
->
page
,
entry
->
offset
,
0
,
FALSE
);
}
if
(
in
)
if
(
in
!=
(
ArrayType
*
)
DatumGetPointer
(
entry
->
key
))
if
(
in
!=
(
ArrayType
*
)
DatumGetPointer
(
entry
->
key
))
pfree
(
in
);
pfree
(
in
);
PG_RETURN_POINTER
(
retval
);
PG_RETURN_POINTER
(
retval
);
}
}
r
=
new_intArrayType
(
SIGLENINT
);
gensign
(
SIGPTR
(
r
),
gensign
(
SIGPTR
(
r
),
ARRPTR
(
in
),
ARRPTR
(
in
),
ARRNELEMS
(
in
));
ARRNELEMS
(
in
));
...
@@ -1230,7 +1162,6 @@ g_intbig_compress(PG_FUNCTION_ARGS)
...
@@ -1230,7 +1162,6 @@ g_intbig_compress(PG_FUNCTION_ARGS)
gistentryinit
(
*
retval
,
PointerGetDatum
(
r
),
entry
->
rel
,
entry
->
page
,
entry
->
offset
,
VARSIZE
(
r
),
FALSE
);
gistentryinit
(
*
retval
,
PointerGetDatum
(
r
),
entry
->
rel
,
entry
->
page
,
entry
->
offset
,
VARSIZE
(
r
),
FALSE
);
if
(
in
)
if
(
in
!=
(
ArrayType
*
)
DatumGetPointer
(
entry
->
key
))
if
(
in
!=
(
ArrayType
*
)
DatumGetPointer
(
entry
->
key
))
pfree
(
in
);
pfree
(
in
);
...
@@ -1243,10 +1174,7 @@ g_intbig_decompress(PG_FUNCTION_ARGS)
...
@@ -1243,10 +1174,7 @@ g_intbig_decompress(PG_FUNCTION_ARGS)
GISTENTRY
*
entry
=
(
GISTENTRY
*
)
PG_GETARG_POINTER
(
0
);
GISTENTRY
*
entry
=
(
GISTENTRY
*
)
PG_GETARG_POINTER
(
0
);
ArrayType
*
key
;
ArrayType
*
key
;
if
(
DatumGetPointer
(
entry
->
key
)
!=
NULL
)
key
=
(
ArrayType
*
)
PG_DETOAST_DATUM
(
entry
->
key
);
key
=
(
ArrayType
*
)
PG_DETOAST_DATUM
(
entry
->
key
);
else
key
=
NULL
;
if
(
key
!=
(
ArrayType
*
)
DatumGetPointer
(
entry
->
key
))
if
(
key
!=
(
ArrayType
*
)
DatumGetPointer
(
entry
->
key
))
{
{
...
@@ -1254,10 +1182,10 @@ g_intbig_decompress(PG_FUNCTION_ARGS)
...
@@ -1254,10 +1182,10 @@ g_intbig_decompress(PG_FUNCTION_ARGS)
retval
=
palloc
(
sizeof
(
GISTENTRY
));
retval
=
palloc
(
sizeof
(
GISTENTRY
));
gistentryinit
(
*
retval
,
PointerGetDatum
(
key
),
entry
->
rel
,
entry
->
page
,
entry
->
offset
,
(
key
)
?
VARSIZE
(
key
)
:
0
,
FALSE
);
gistentryinit
(
*
retval
,
PointerGetDatum
(
key
),
entry
->
rel
,
entry
->
page
,
entry
->
offset
,
(
key
)
?
VARSIZE
(
key
)
:
0
,
FALSE
);
PG_RETURN_POINTER
(
retval
);
PG_RETURN_POINTER
(
retval
);
}
}
if
(
!
ARRISNULL
(
key
)
)
if
(
ARRNELEMS
(
key
)
==
1
)
{
if
(
ARRNELEMS
(
key
)
==
1
)
{
GISTENTRY
*
retval
;
GISTENTRY
*
retval
;
ArrayType
*
newkey
;
ArrayType
*
newkey
;
...
@@ -1266,7 +1194,8 @@ g_intbig_decompress(PG_FUNCTION_ARGS)
...
@@ -1266,7 +1194,8 @@ g_intbig_decompress(PG_FUNCTION_ARGS)
newkey
=
new_intArrayType
(
SIGLENINT
);
newkey
=
new_intArrayType
(
SIGLENINT
);
MemSet
(
(
void
*
)
ARRPTR
(
newkey
),
0xff
,
SIGLEN
);
MemSet
(
(
void
*
)
ARRPTR
(
newkey
),
0xff
,
SIGLEN
);
gistentryinit
(
*
retval
,
PointerGetDatum
(
newkey
),
entry
->
rel
,
entry
->
page
,
entry
->
offset
,
VARSIZE
(
newkey
),
FALSE
);
gistentryinit
(
*
retval
,
PointerGetDatum
(
newkey
),
entry
->
rel
,
entry
->
page
,
entry
->
offset
,
VARSIZE
(
newkey
),
FALSE
);
PG_RETURN_POINTER
(
retval
);
PG_RETURN_POINTER
(
retval
);
}
}
PG_RETURN_POINTER
(
entry
);
PG_RETURN_POINTER
(
entry
);
...
@@ -1281,7 +1210,7 @@ g_intbig_picksplit(PG_FUNCTION_ARGS)
...
@@ -1281,7 +1210,7 @@ g_intbig_picksplit(PG_FUNCTION_ARGS)
_intbig_union
,
_intbig_union
,
_intbig_inter
,
_intbig_inter
,
rt__intbig_size
,
rt__intbig_size
,
1
.
0
0
.
1
)
);
)
);
}
}
...
@@ -1379,6 +1308,7 @@ _int_common_union(bytea *entryvec, int *sizep, formarray unionf)
...
@@ -1379,6 +1308,7 @@ _int_common_union(bytea *entryvec, int *sizep, formarray unionf)
tmp
=
out
;
tmp
=
out
;
}
}
out
->
flags
&=
~
LEAFKEY
;
*
sizep
=
VARSIZE
(
out
);
*
sizep
=
VARSIZE
(
out
);
if
(
*
sizep
==
0
)
if
(
*
sizep
==
0
)
{
{
...
@@ -1425,6 +1355,19 @@ _int_common_penalty(GISTENTRY *origentry, GISTENTRY *newentry, float *result,
...
@@ -1425,6 +1355,19 @@ _int_common_penalty(GISTENTRY *origentry, GISTENTRY *newentry, float *result,
return
(
result
);
return
(
result
);
}
}
typedef
struct
{
OffsetNumber
pos
;
float
cost
;
}
SPLITCOST
;
static
int
comparecost
(
const
void
*
a
,
const
void
*
b
)
{
if
(
((
SPLITCOST
*
)
a
)
->
cost
==
((
SPLITCOST
*
)
b
)
->
cost
)
return
0
;
else
return
(
((
SPLITCOST
*
)
a
)
->
cost
>
((
SPLITCOST
*
)
b
)
->
cost
)
?
1
:
-
1
;
}
/*
/*
** The GiST PickSplit method for _intments
** The GiST PickSplit method for _intments
** We use Guttman's poly time split algorithm
** We use Guttman's poly time split algorithm
...
@@ -1462,6 +1405,7 @@ _int_common_picksplit(bytea *entryvec,
...
@@ -1462,6 +1405,7 @@ _int_common_picksplit(bytea *entryvec,
OffsetNumber
*
left
,
OffsetNumber
*
left
,
*
right
;
*
right
;
OffsetNumber
maxoff
;
OffsetNumber
maxoff
;
SPLITCOST
*
costvector
;
#ifdef GIST_DEBUG
#ifdef GIST_DEBUG
elog
(
NOTICE
,
"--------picksplit %d"
,
(
VARSIZE
(
entryvec
)
-
VARHDRSZ
)
/
sizeof
(
GISTENTRY
));
elog
(
NOTICE
,
"--------picksplit %d"
,
(
VARSIZE
(
entryvec
)
-
VARHDRSZ
)
/
sizeof
(
GISTENTRY
));
...
@@ -1521,6 +1465,24 @@ _int_common_picksplit(bytea *entryvec,
...
@@ -1521,6 +1465,24 @@ _int_common_picksplit(bytea *entryvec,
datum_r
=
copy_intArrayType
(
datum_beta
);
datum_r
=
copy_intArrayType
(
datum_beta
);
(
*
sizef
)
(
datum_r
,
&
size_r
);
(
*
sizef
)
(
datum_r
,
&
size_r
);
maxoff
=
OffsetNumberNext
(
maxoff
);
/*
* sort entries
*/
costvector
=
(
SPLITCOST
*
)
palloc
(
sizeof
(
SPLITCOST
)
*
maxoff
);
for
(
i
=
FirstOffsetNumber
;
i
<=
maxoff
;
i
=
OffsetNumberNext
(
i
))
{
costvector
[
i
-
1
].
pos
=
i
;
datum_alpha
=
(
ArrayType
*
)
DatumGetPointer
(((
GISTENTRY
*
)
VARDATA
(
entryvec
))[
i
].
key
);
union_d
=
(
*
unionf
)(
datum_l
,
datum_alpha
);
(
*
sizef
)(
union_d
,
&
size_alpha
);
pfree
(
union_d
);
union_d
=
(
*
unionf
)(
datum_r
,
datum_alpha
);
(
*
sizef
)(
union_d
,
&
size_beta
);
pfree
(
union_d
);
costvector
[
i
-
1
].
cost
=
abs
(
(
size_alpha
-
size_l
)
-
(
size_beta
-
size_r
)
);
}
qsort
(
(
void
*
)
costvector
,
maxoff
,
sizeof
(
SPLITCOST
),
comparecost
);
/*
/*
* Now split up the regions between the two seeds. An important
* Now split up the regions between the two seeds. An important
* property of this split algorithm is that the split vector v has the
* property of this split algorithm is that the split vector v has the
...
@@ -1533,10 +1495,9 @@ _int_common_picksplit(bytea *entryvec,
...
@@ -1533,10 +1495,9 @@ _int_common_picksplit(bytea *entryvec,
* tuples and i == maxoff + 1.
* tuples and i == maxoff + 1.
*/
*/
maxoff
=
OffsetNumberNext
(
maxoff
);
for
(
i
=
FirstOffsetNumber
;
i
<=
maxoff
;
i
=
OffsetNumberNext
(
i
))
{
for
(
j
=
0
;
j
<
maxoff
;
j
++
)
{
i
=
costvector
[
j
].
pos
;
/*
/*
* If we've already decided where to place this item, just put it
* If we've already decided where to place this item, just put it
...
@@ -1588,18 +1549,11 @@ _int_common_picksplit(bytea *entryvec,
...
@@ -1588,18 +1549,11 @@ _int_common_picksplit(bytea *entryvec,
v
->
spl_nright
++
;
v
->
spl_nright
++
;
}
}
}
}
pfree
(
costvector
);
*
right
=
*
left
=
FirstOffsetNumber
;
if
(
*
(
left
-
1
)
>
*
(
right
-
1
))
datum_l
->
flags
&=
~
LEAFKEY
;
{
datum_r
->
flags
&=
~
LEAFKEY
;
*
right
=
FirstOffsetNumber
;
*
(
left
-
1
)
=
InvalidOffsetNumber
;
}
else
{
*
left
=
FirstOffsetNumber
;
*
(
right
-
1
)
=
InvalidOffsetNumber
;
}
v
->
spl_ldatum
=
PointerGetDatum
(
datum_l
);
v
->
spl_ldatum
=
PointerGetDatum
(
datum_l
);
v
->
spl_rdatum
=
PointerGetDatum
(
datum_r
);
v
->
spl_rdatum
=
PointerGetDatum
(
datum_r
);
...
...
This diff is collapsed.
Click to expand it.
contrib/intarray/_int.sql.in
+
6
−
6
View file @
14b0da2a
...
@@ -169,7 +169,7 @@ WHERE o.oprleft = t.oid and ( o.oprright = t.oid or o.oprright=tq.oid )
...
@@ -169,7 +169,7 @@ WHERE o.oprleft = t.oid and ( o.oprright = t.oid or o.oprright=tq.oid )
-- _int_overlap
-- _int_overlap
INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
SELECT opcl.oid, 3,
tru
e, c.opoid
SELECT opcl.oid, 3,
fals
e, c.opoid
FROM pg_opclass opcl, _int_ops_tmp c
FROM pg_opclass opcl, _int_ops_tmp c
WHERE
WHERE
opcamid = (SELECT oid FROM pg_am WHERE amname = 'gist')
opcamid = (SELECT oid FROM pg_am WHERE amname = 'gist')
...
@@ -178,7 +178,7 @@ INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
...
@@ -178,7 +178,7 @@ INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
-- _int_same
-- _int_same
INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
SELECT opcl.oid, 6,
tru
e, c.opoid
SELECT opcl.oid, 6,
fals
e, c.opoid
FROM pg_opclass opcl, _int_ops_tmp c
FROM pg_opclass opcl, _int_ops_tmp c
WHERE
WHERE
opcamid = (SELECT oid FROM pg_am WHERE amname = 'gist')
opcamid = (SELECT oid FROM pg_am WHERE amname = 'gist')
...
@@ -187,7 +187,7 @@ INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
...
@@ -187,7 +187,7 @@ INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
-- _int_contains
-- _int_contains
INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
SELECT opcl.oid, 7,
tru
e, c.opoid
SELECT opcl.oid, 7,
fals
e, c.opoid
FROM pg_opclass opcl, _int_ops_tmp c
FROM pg_opclass opcl, _int_ops_tmp c
WHERE
WHERE
opcamid = (SELECT oid FROM pg_am WHERE amname = 'gist')
opcamid = (SELECT oid FROM pg_am WHERE amname = 'gist')
...
@@ -196,7 +196,7 @@ INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
...
@@ -196,7 +196,7 @@ INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
-- _int_contained
-- _int_contained
INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
SELECT opcl.oid, 8,
tru
e, c.opoid
SELECT opcl.oid, 8,
fals
e, c.opoid
FROM pg_opclass opcl, _int_ops_tmp c
FROM pg_opclass opcl, _int_ops_tmp c
WHERE
WHERE
opcamid = (SELECT oid FROM pg_am WHERE amname = 'gist')
opcamid = (SELECT oid FROM pg_am WHERE amname = 'gist')
...
@@ -205,7 +205,7 @@ INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
...
@@ -205,7 +205,7 @@ INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
--boolean search
--boolean search
INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
SELECT opcl.oid, 20,
tru
e, c.opoid
SELECT opcl.oid, 20,
fals
e, c.opoid
FROM pg_opclass opcl, _int_ops_tmp c
FROM pg_opclass opcl, _int_ops_tmp c
WHERE
WHERE
opcamid = (SELECT oid FROM pg_am WHERE amname = 'gist')
opcamid = (SELECT oid FROM pg_am WHERE amname = 'gist')
...
@@ -213,7 +213,7 @@ INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
...
@@ -213,7 +213,7 @@ INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
and c.oprname = '@@';
and c.oprname = '@@';
INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
SELECT opcl.oid, 20,
tru
e, c.opoid
SELECT opcl.oid, 20,
fals
e, c.opoid
FROM pg_opclass opcl, _int_ops_tmp c
FROM pg_opclass opcl, _int_ops_tmp c
WHERE
WHERE
opcamid = (SELECT oid FROM pg_am WHERE amname = 'gist')
opcamid = (SELECT oid FROM pg_am WHERE amname = 'gist')
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment