-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add split_time_range optimizer (#1091)
Context: We noticed that for some schemas (that don't ORDER BY time), the "Discover" view in Kibana over long time ranges can be very slow, even though it only shows 500 results. Changing the time range to a shorter one can make the query faster. (See this issue in ClickHouse for a similar example: ClickHouse/ClickHouse#69315) This optimization therefore splits the time range into parts: a short time range, on which we bet that the query will be fast (and still return LIMIT many results) and a long time range, which will be used to get the rest of the results (in case the short time range didn't return enough results). The ranges are customizable (potentially even more than 2). During the development I also fixed two related problems: - added `AliasColumnsTransformation` which makes sure that the queries we generate have columns with clear names (so that I can reference them when they are in subquery) - `read` from ClickHouse now only reads `LIMIT` many rows and closes `Rows` asynchronously (don't wait for query completion if we read `LIMIT` many rows) --------- Signed-off-by: Piotr Grabowski <[email protected]> Co-authored-by: Jacek Migdal <[email protected]>
- Loading branch information
1 parent
33bae75
commit 047ed16
Showing
10 changed files
with
376 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.