Skip to content

Commit 5a4ce07

Browse files
committed
Creating indexes to speedup usersearch and email search (#260)
1 parent 63071f9 commit 5a4ce07

6 files changed

Lines changed: 5936 additions & 24 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CREATE EXTENSION IF NOT EXISTS "pg_trgm";;--> statement-breakpoint
2+
CREATE EXTENSION IF NOT EXISTS "btree_gin";;--> statement-breakpoint
3+
CREATE INDEX IF NOT EXISTS "users_email_index" ON "users" USING gin ("email" gin_trgm_ops );--> statement-breakpoint
4+
CREATE INDEX IF NOT EXISTS "users_name_index" ON "users" USING gin ("name" gin_trgm_ops );;--> statement-breakpoint
5+
CREATE INDEX IF NOT EXISTS "users_last_name_index" ON "users" USING gin ("lastName" gin_trgm_ops );--> statement-breakpoint
6+
CREATE INDEX IF NOT EXISTS "users_username_index" ON "users" USING gin ("username" gin_trgm_ops );
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
DROP INDEX IF EXISTS "users_email_index";--> statement-breakpoint
2+
CREATE INDEX IF NOT EXISTS "users_email_index" ON "users" USING btree ("email");

0 commit comments

Comments
 (0)