Fix index used by get random packages query (#1502)

Signed-off-by: Sergio Castaño Arteaga <tegioz@icloud.com>
This commit is contained in:
Sergio C. Arteaga 2021-08-19 10:14:50 +02:00 committed by GitHub
parent f9d1effae5
commit 062df42b9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1,9 @@
drop index snapshot_not_deprecated_with_readme_idx;
create index snapshot_not_deprecated_with_readme_idx on snapshot (package_id, version) include (ts)
where (deprecated is null or deprecated = false) and readme is not null;
---- create above / drop below ----
drop index snapshot_not_deprecated_with_readme_idx;
create index snapshot_not_deprecated_with_readme_idx on snapshot (package_id, version) include (created_at)
where (deprecated is null or deprecated = false) and readme is not null;