Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to use index when GROUP BY on field which has DESCENDING index [CORE4529] #4847

Closed
firebird-automations opened this issue Aug 25, 2014 · 7 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

SQL> recreate table t(x int, y int); commit;
SQL> insert into t select rand()*5, rand()*5 from rdb$types, rdb$types; commit;
SQL> create DESCENDING index t_x_desc on t(x); commit;
SQL> set planonly;
SQL> select x,max(y) from t group by x;

PLAN SORT (T NATURAL) -- ? :(

SQL> select x,min(y) from t group by x;

PLAN SORT (T NATURAL) -- ? :(

SQL> set planonly;
SQL> drop index t_x_desc; commit;

---------- compare when ASC index on this field: --------

SQL> create index t_x_asc on t(x); commit;
SQL> set planonly;
SQL> select x,max(y) from t group by x;

PLAN (T ORDER T_X_ASC)
SQL> select x,min(y) from t group by x;

PLAN (T ORDER T_X_ASC)
SQL> set planonly;
SQL> drop index t_x_asc; commit;

PS. LI-T3.0.0.31288

Commits: 40c7b29

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

priority: Major [ 3 ] => Minor [ 4 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Nico Bendlin (nicode)

Adding ORDER BY x DESC results in: PLAN (T ORDER T_X_DESC)

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Dmitry Yemanov [ dimitr ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 4.0 Beta 1 [ 10750 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Component: Engine [ 10000 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: Done successfully

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants