-
Notifications
You must be signed in to change notification settings - Fork 328
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change structure of how we store the various analytics time fields.
Instead of storing the individual components, we're now storing a full date or timestamp string, giving the starting date of that block. So, for example, for 2016-03-23, the request_at_tz_year would be 2016-01-01, the request_at_tz_month would be 2016-03-01, etc. While the previous storage of the individual components was more efficient (from a space perspective), and less duplicative, the reason for this switch is for a couple reasons: - In order to query the previous individual fields, we had to concatenate them at query time. Skipping concatenation actually gives us a decent performance boost when the queries have to fallback to Presto (in an example query, it was consistently taking 60 seconds with concating, vs 45 seconds without concating). - The bigger stumbling block we ran into was that Presto doesn't support CASTing to CHARs. This meant various queries couldn't fallback to Presto. We could cast to VARCHAR in Presto, but then the sorting the dates wouldn't work properly, since the integers weren't zero-padded (so 12 would come before 2). - Despite the less efficient storage (although, I don't think it should actually make much of a huge difference in the columnar store), this approach does greatly simplify querying (since you only ever have to GROUP BY a single time field).
- Loading branch information
Showing
5 changed files
with
47 additions
and
32 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
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