-
-
Notifications
You must be signed in to change notification settings - Fork 793
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exclude null values from image studio id index
- Loading branch information
1 parent
9765b6d
commit fc1fe05
Showing
2 changed files
with
8 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
-- with the existing index, if no images have a studio id, then the index is | ||
-- not used when filtering by studio id. The assumption with this change is that | ||
-- most images don't have a studio id, so filtering by non-null studio id should | ||
-- be faster with this index. This is a tradeoff, as filtering by null studio id | ||
-- will be slower. | ||
DROP INDEX index_images_on_studio_id; | ||
CREATE INDEX `index_images_on_studio_id` on `images` (`studio_id`) WHERE `studio_id` IS NOT NULL; |