]> Untitled Git - lemmy.git/commitdiff
Add db index for post.url column (#2929)
authorNutomic <me@nutomic.com>
Wed, 7 Jun 2023 15:31:24 +0000 (17:31 +0200)
committerGitHub <noreply@github.com>
Wed, 7 Jun 2023 15:31:24 +0000 (11:31 -0400)
* Add db index for post.url column

As mentioned in https://github.com/LemmyNet/lemmy/issues/2877#issuecomment-1576439829

Not sure if its preferable to do this, or make a combined index
which includes post.nsfw, post.removed, post.deleted

* remove unique

migrations/2023-06-06-104440_index_post_url/down.sql [new file with mode: 0644]
migrations/2023-06-06-104440_index_post_url/up.sql [new file with mode: 0644]

diff --git a/migrations/2023-06-06-104440_index_post_url/down.sql b/migrations/2023-06-06-104440_index_post_url/down.sql
new file mode 100644 (file)
index 0000000..5a60b13
--- /dev/null
@@ -0,0 +1 @@
+drop index idx_post_url;
diff --git a/migrations/2023-06-06-104440_index_post_url/up.sql b/migrations/2023-06-06-104440_index_post_url/up.sql
new file mode 100644 (file)
index 0000000..4f8ea66
--- /dev/null
@@ -0,0 +1 @@
+create index idx_post_url on post(url);