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-issue-importer opened this issue Aug 25, 2014 · 7 comments

Comments

@firebird-issue-importer

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-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Aug 25, 2014

Modified by: @pavel-zotov

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 28, 2016

Commented by: Nico Bendlin (nicode)

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 23, 2017

Modified by: @dyemanov

assignee: Dmitry Yemanov [ dimitr ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 23, 2017

Modified by: @dyemanov

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

resolution: Fixed [ 1 ]

Fix Version: 4.0 Beta 1 [ 10750 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 23, 2017

Modified by: @dyemanov

Component: Engine [ 10000 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 25, 2017

Modified by: @pavel-zotov

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

QA Status: Done successfully

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 25, 2017

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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants