Skip to content

Optimization of ORDER BY with respect to the ORDER key in MergeTree tables (continuation of #5042).#6054

Merged
KochetovNicolai merged 59 commits intoClickHouse:masterfrom
CurtizJ:order-by-efficient
Jul 27, 2019
Merged

Optimization of ORDER BY with respect to the ORDER key in MergeTree tables (continuation of #5042).#6054
KochetovNicolai merged 59 commits intoClickHouse:masterfrom
CurtizJ:order-by-efficient

Conversation

@CurtizJ
Copy link
Copy Markdown
Member

@CurtizJ CurtizJ commented Jul 18, 2019

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

For changelog. Remove if this is non-significant change.

Category (leave one):

  • Performance Improvement

Short description (up to few sentences):
Optimize queries with ORDER BY expressions clause, where expressions have coinciding prefix with ORDER key in MergeTree tables.

Detailed description (optional):
In these queries data now is read in order of order key. This allows to avoid reading all data in case of specified limit. Optimization works with both ASC and DESC and doesn't work together with GROUP BY clause and FINAL modifier.

Continuation of #5042.

TODO:

  • support optimization for monotonic functions.
  • refactor to avoid code duplication.
  • implement for processors. (will be implemented in separate task).

anrodigina and others added 30 commits April 17, 2019 23:57
anrodigina and others added 24 commits May 26, 2019 20:43
@CurtizJ CurtizJ marked this pull request as ready for review July 27, 2019 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-performance Pull request with some performance improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants