From: Olivier Mehani Date: Tue, 6 Aug 2019 12:39:12 +0000 (+1000) Subject: Add index on starred entries X-Git-Url: https://git.immae.eu/?p=github%2Fwallabag%2Fwallabag.git;a=commitdiff_plain;h=5071c8c9cf4d3fcb79851e3ea089593c81cd3b02 Add index on starred entries Fixes #4079 Signed-off-by: Olivier Mehani --- diff --git a/app/DoctrineMigrations/Version20190806131006.php b/app/DoctrineMigrations/Version20190806131006.php new file mode 100644 index 00000000..7ad45b57 --- /dev/null +++ b/app/DoctrineMigrations/Version20190806131006.php @@ -0,0 +1,22 @@ +addSql('CREATE INDEX user_starred ON wallabag_entry (user_id, is_starred, starred_at)'); + } + + public function down(Schema $schema) : void + { + $this->addSql('DROP INDEX user_starred ON `wallabag_entry`'); + } +} diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index eb185b8c..593ff01d 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -29,7 +29,8 @@ use Wallabag\UserBundle\Entity\User; * @ORM\Index(name="uid", columns={"uid"}), * @ORM\Index(name="hashed_url_user_id", columns={"user_id", "hashed_url"}, options={"lengths"={null, 40}}), * @ORM\Index(name="hashed_given_url_user_id", columns={"user_id", "hashed_given_url"}, options={"lengths"={null, 40}}), - * @ORM\Index(name="user_language", columns={"language", "user_id"}) + * @ORM\Index(name="user_language", columns={"language", "user_id"}), + * @ORM\Index(name="user_starred", columns={"user_id", "is_starred", "starred_at"}) * } * ) * @ORM\HasLifecycleCallbacks()