Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
3afffbc9
Commit
3afffbc9
authored
Oct 20, 2008
by
Teodor Sigaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove support of backward scan in GiST. Per discussion
http://archives.postgresql.org/pgsql-hackers/2008-10/msg00857.php
parent
a6ebb1f2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
25 deletions
+15
-25
src/backend/access/gist/gistget.c
src/backend/access/gist/gistget.c
+15
-25
No files found.
src/backend/access/gist/gistget.c
View file @
3afffbc9
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/gist/gistget.c,v 1.7
7 2008/10/20 13:39:4
4 teodor Exp $
* $PostgreSQL: pgsql/src/backend/access/gist/gistget.c,v 1.7
8 2008/10/20 16:35:1
4 teodor Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -23,9 +23,8 @@
...
@@ -23,9 +23,8 @@
#include "utils/memutils.h"
#include "utils/memutils.h"
static
OffsetNumber
gistfindnext
(
IndexScanDesc
scan
,
OffsetNumber
n
,
static
OffsetNumber
gistfindnext
(
IndexScanDesc
scan
,
OffsetNumber
n
);
ScanDirection
dir
);
static
int64
gistnext
(
IndexScanDesc
scan
,
TIDBitmap
*
tbm
);
static
int64
gistnext
(
IndexScanDesc
scan
,
ScanDirection
dir
,
TIDBitmap
*
tbm
);
static
bool
gistindex_keytest
(
IndexTuple
tuple
,
IndexScanDesc
scan
,
static
bool
gistindex_keytest
(
IndexTuple
tuple
,
IndexScanDesc
scan
,
OffsetNumber
offset
);
OffsetNumber
offset
);
...
@@ -80,6 +79,9 @@ gistgettuple(PG_FUNCTION_ARGS)
...
@@ -80,6 +79,9 @@ gistgettuple(PG_FUNCTION_ARGS)
so
=
(
GISTScanOpaque
)
scan
->
opaque
;
so
=
(
GISTScanOpaque
)
scan
->
opaque
;
if
(
dir
!=
ForwardScanDirection
)
elog
(
ERROR
,
"GiST doesn't support other scan directions than forward"
);
/*
/*
* If we have produced an index tuple in the past and the executor has
* If we have produced an index tuple in the past and the executor has
* informed us we need to mark it as "killed", do so now.
* informed us we need to mark it as "killed", do so now.
...
@@ -90,7 +92,7 @@ gistgettuple(PG_FUNCTION_ARGS)
...
@@ -90,7 +92,7 @@ gistgettuple(PG_FUNCTION_ARGS)
/*
/*
* Get the next tuple that matches the search key.
* Get the next tuple that matches the search key.
*/
*/
res
=
(
gistnext
(
scan
,
dir
,
NULL
)
>
0
);
res
=
(
gistnext
(
scan
,
NULL
)
>
0
);
PG_RETURN_BOOL
(
res
);
PG_RETURN_BOOL
(
res
);
}
}
...
@@ -102,7 +104,7 @@ gistgetbitmap(PG_FUNCTION_ARGS)
...
@@ -102,7 +104,7 @@ gistgetbitmap(PG_FUNCTION_ARGS)
TIDBitmap
*
tbm
=
(
TIDBitmap
*
)
PG_GETARG_POINTER
(
1
);
TIDBitmap
*
tbm
=
(
TIDBitmap
*
)
PG_GETARG_POINTER
(
1
);
int64
ntids
;
int64
ntids
;
ntids
=
gistnext
(
scan
,
ForwardScanDirection
,
tbm
);
ntids
=
gistnext
(
scan
,
tbm
);
PG_RETURN_INT64
(
ntids
);
PG_RETURN_INT64
(
ntids
);
}
}
...
@@ -122,7 +124,7 @@ gistgetbitmap(PG_FUNCTION_ARGS)
...
@@ -122,7 +124,7 @@ gistgetbitmap(PG_FUNCTION_ARGS)
* non-killed tuple that matches the search key.
* non-killed tuple that matches the search key.
*/
*/
static
int64
static
int64
gistnext
(
IndexScanDesc
scan
,
ScanDirection
dir
,
TIDBitmap
*
tbm
)
gistnext
(
IndexScanDesc
scan
,
TIDBitmap
*
tbm
)
{
{
Page
p
;
Page
p
;
OffsetNumber
n
;
OffsetNumber
n
;
...
@@ -169,9 +171,6 @@ gistnext(IndexScanDesc scan, ScanDirection dir, TIDBitmap *tbm)
...
@@ -169,9 +171,6 @@ gistnext(IndexScanDesc scan, ScanDirection dir, TIDBitmap *tbm)
if
(
so
->
curPageData
<
so
->
nPageData
)
if
(
so
->
curPageData
<
so
->
nPageData
)
{
{
/*
* pageData is already ordered for scan's direction
*/
scan
->
xs_ctup
.
t_self
=
so
->
pageData
[
so
->
curPageData
].
iptr
;
scan
->
xs_ctup
.
t_self
=
so
->
pageData
[
so
->
curPageData
].
iptr
;
scan
->
xs_recheck
=
so
->
pageData
[
so
->
curPageData
].
recheck
;
scan
->
xs_recheck
=
so
->
pageData
[
so
->
curPageData
].
recheck
;
so
->
curPageData
++
;
so
->
curPageData
++
;
...
@@ -252,9 +251,6 @@ gistnext(IndexScanDesc scan, ScanDirection dir, TIDBitmap *tbm)
...
@@ -252,9 +251,6 @@ gistnext(IndexScanDesc scan, ScanDirection dir, TIDBitmap *tbm)
continue
;
continue
;
}
}
if
(
ScanDirectionIsBackward
(
dir
))
n
=
PageGetMaxOffsetNumber
(
p
);
else
n
=
FirstOffsetNumber
;
n
=
FirstOffsetNumber
;
/* wonderful, we can look at page */
/* wonderful, we can look at page */
...
@@ -262,7 +258,7 @@ gistnext(IndexScanDesc scan, ScanDirection dir, TIDBitmap *tbm)
...
@@ -262,7 +258,7 @@ gistnext(IndexScanDesc scan, ScanDirection dir, TIDBitmap *tbm)
for
(;;)
for
(;;)
{
{
n
=
gistfindnext
(
scan
,
n
,
dir
);
n
=
gistfindnext
(
scan
,
n
);
if
(
!
OffsetNumberIsValid
(
n
))
if
(
!
OffsetNumberIsValid
(
n
))
{
{
...
@@ -275,7 +271,7 @@ gistnext(IndexScanDesc scan, ScanDirection dir, TIDBitmap *tbm)
...
@@ -275,7 +271,7 @@ gistnext(IndexScanDesc scan, ScanDirection dir, TIDBitmap *tbm)
if
(
!
tbm
&&
so
->
nPageData
>
0
)
if
(
!
tbm
&&
so
->
nPageData
>
0
)
{
{
LockBuffer
(
so
->
curbuf
,
GIST_UNLOCK
);
LockBuffer
(
so
->
curbuf
,
GIST_UNLOCK
);
return
gistnext
(
scan
,
dir
,
NULL
);
return
gistnext
(
scan
,
NULL
);
}
}
/*
/*
...
@@ -346,9 +342,6 @@ gistnext(IndexScanDesc scan, ScanDirection dir, TIDBitmap *tbm)
...
@@ -346,9 +342,6 @@ gistnext(IndexScanDesc scan, ScanDirection dir, TIDBitmap *tbm)
so
->
stack
->
next
=
stk
;
so
->
stack
->
next
=
stk
;
}
}
if
(
ScanDirectionIsBackward
(
dir
))
n
=
OffsetNumberPrev
(
n
);
else
n
=
OffsetNumberNext
(
n
);
n
=
OffsetNumberNext
(
n
);
}
}
}
}
...
@@ -475,7 +468,7 @@ gistindex_keytest(IndexTuple tuple,
...
@@ -475,7 +468,7 @@ gistindex_keytest(IndexTuple tuple,
* Page should be locked....
* Page should be locked....
*/
*/
static
OffsetNumber
static
OffsetNumber
gistfindnext
(
IndexScanDesc
scan
,
OffsetNumber
n
,
ScanDirection
dir
)
gistfindnext
(
IndexScanDesc
scan
,
OffsetNumber
n
)
{
{
OffsetNumber
maxoff
;
OffsetNumber
maxoff
;
IndexTuple
it
;
IndexTuple
it
;
...
@@ -500,9 +493,6 @@ gistfindnext(IndexScanDesc scan, OffsetNumber n, ScanDirection dir)
...
@@ -500,9 +493,6 @@ gistfindnext(IndexScanDesc scan, OffsetNumber n, ScanDirection dir)
if
(
gistindex_keytest
(
it
,
scan
,
n
))
if
(
gistindex_keytest
(
it
,
scan
,
n
))
break
;
break
;
if
(
ScanDirectionIsBackward
(
dir
))
n
=
OffsetNumberPrev
(
n
);
else
n
=
OffsetNumberNext
(
n
);
n
=
OffsetNumberNext
(
n
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment