-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve get stats db function performance
Signed-off-by: Sergio Castaño Arteaga <tegioz@icloud.com>
- Loading branch information
Showing
2 changed files
with
7 additions
and
2 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
5 changes: 5 additions & 0 deletions
5
database/migrations/schema/052_package_views_year_month_index.sql
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
create index if not exists package_views_year_month_idx on package_views (date_trunc('year', day::timestamp), date_trunc('month', day::timestamp)); | ||
|
||
---- create above / drop below ---- | ||
|
||
drop index if exists package_views_year_month_idx; |