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
eb4f58ad
Commit
eb4f58ad
authored
Apr 20, 2005
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't try to run clauseless index scans on index types that don't support
it. Per report from Marinos Yannikos.
parent
a8ac7d87
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
src/backend/optimizer/path/indxpath.c
src/backend/optimizer/path/indxpath.c
+17
-7
No files found.
src/backend/optimizer/path/indxpath.c
View file @
eb4f58ad
...
...
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/path/indxpath.c,v 1.17
3 2005/04/11 23:06:55
tgl Exp $
* $PostgreSQL: pgsql/src/backend/optimizer/path/indxpath.c,v 1.17
4 2005/04/20 21:48:04
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -146,11 +146,16 @@ create_index_paths(Query *root, RelOptInfo *rel)
* 2. Compute pathkeys describing index's ordering, if any, then
* see how many of them are actually useful for this query.
*/
index_pathkeys
=
build_index_pathkeys
(
root
,
index
,
ForwardScanDirection
);
index_is_ordered
=
(
index_pathkeys
!=
NIL
);
useful_pathkeys
=
truncate_useless_pathkeys
(
root
,
rel
,
index_pathkeys
);
index_is_ordered
=
OidIsValid
(
index
->
ordering
[
0
]);
if
(
index_is_ordered
)
{
index_pathkeys
=
build_index_pathkeys
(
root
,
index
,
ForwardScanDirection
);
useful_pathkeys
=
truncate_useless_pathkeys
(
root
,
rel
,
index_pathkeys
);
}
else
useful_pathkeys
=
NIL
;
/*
* 3. Generate an indexscan path if there are relevant restriction
...
...
@@ -160,10 +165,15 @@ create_index_paths(Query *root, RelOptInfo *rel)
* If there is a predicate, consider it anyway since the index
* predicate has already been found to match the query. The
* selectivity of the predicate might alone make the index useful.
*
* Note: not all index AMs support scans with no restriction clauses.
* We assume here that the AM does so if and only if it supports
* ordered scans. (It would probably be better if there were a
* specific flag for this in pg_am, but there's not.)
*/
if
(
restrictclauses
!=
NIL
||
useful_pathkeys
!=
NIL
||
index
->
indpred
!=
NIL
)
(
index
->
indpred
!=
NIL
&&
index_is_ordered
)
)
add_path
(
rel
,
(
Path
*
)
create_index_path
(
root
,
index
,
restrictclauses
,
...
...
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