Skip to content

Commit 7fc9d43

Browse files
Merge #1527
1527: Add a missing index on crates r=sgrif a=sgrif Our most time consuming query is coming from crawlers on /crates ordered by name. It turns out this query was not using any indexes, as the only index we have on `crates.name` is `canon_crate_name(name)`. An alternative would be to order by `canon_crate_name(name)` instead, but that shouldn't actually be able to change the order. This is a low write table, so the extra index isn't a major cost. Adding an index instead of changing the query means the effects of this change will be easier to see. The weird index name is because we already have an index called `index_crates_name`. Co-authored-by: Sean Griffin <[email protected]>
2 parents 27842db + 80763f6 commit 7fc9d43

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DROP INDEX index_crates_name_ordering;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CREATE INDEX index_crates_name_ordering ON crates (name);

0 commit comments

Comments
 (0)