-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve report performance with high-cardinality import joins (#4848)
* Improve report performance in cases where site has a lot of unique pathnames Ref: https://3.basecamp.com/5308029/buckets/39750953/card_tables/cards/8052057081 JOINs in ClickHouse are slow. In one degenerate case I found a user had over 20 million unique paths in an import, which resulted in extremely slow JOINs. This introduces a sort-of hacky solution to it by limiting the amount of data analyzed. Query timing without this change: ``` 9 rows in set. Elapsed: 11.383 sec. Processed 49.16 million rows, 5.75 GB (4.32 million rows/s., 505.29 MB/s.) Peak memory usage: 14.75 GiB. ``` After: ``` 9 rows in set. Elapsed: 0.572 sec. Processed 49.18 million rows, 5.75 GB (86.03 million rows/s., 10.06 GB/s.) Peak memory usage: 9.01 GiB. ``` * Splitting should no longer remove pagination. Handle special cases in special_metrics.ex * select_merge_as in imports This sets up selected_as aliases which will be used in a subsequent commit * Add explicit ORDER BY to import * Rewrite comment * quoting * merge conflict * Split test * Merge conflict fail fix
- Loading branch information
Showing
7 changed files
with
187 additions
and
176 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
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.