Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions drizzle/0006_yummy_rattler.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CREATE INDEX "entities_rank_commits_idx" ON "entities" USING btree ("total_commits" DESC NULLS LAST,"id") WHERE "entities"."kind" = 'user' and "entities"."suspended_at" is null and "entities"."built_at" is not null;--> statement-breakpoint
CREATE INDEX "entities_rank_prs_idx" ON "entities" USING btree ("total_pull_requests" DESC NULLS LAST,"id") WHERE "entities"."kind" = 'user' and "entities"."suspended_at" is null and "entities"."built_at" is not null;--> statement-breakpoint
CREATE INDEX "entities_rank_issues_idx" ON "entities" USING btree ("total_issues" DESC NULLS LAST,"id") WHERE "entities"."kind" = 'user' and "entities"."suspended_at" is null and "entities"."built_at" is not null;--> statement-breakpoint
CREATE INDEX "entities_rank_reviews_idx" ON "entities" USING btree ("total_reviews" DESC NULLS LAST,"id") WHERE "entities"."kind" = 'user' and "entities"."suspended_at" is null and "entities"."built_at" is not null;--> statement-breakpoint
CREATE INDEX "entities_rank_repos_idx" ON "entities" USING btree ("total_repos" DESC NULLS LAST,"id") WHERE "entities"."kind" = 'user' and "entities"."suspended_at" is null and "entities"."built_at" is not null;--> statement-breakpoint
CREATE INDEX "entities_rank_private_idx" ON "entities" USING btree ("total_restricted" DESC NULLS LAST,"id") WHERE "entities"."kind" = 'user' and "entities"."suspended_at" is null and "entities"."built_at" is not null;--> statement-breakpoint
CREATE INDEX "entities_rank_followers_idx" ON "entities" USING btree ("followers" DESC NULLS LAST,"id") WHERE "entities"."kind" = 'user' and "entities"."suspended_at" is null and "entities"."built_at" is not null;--> statement-breakpoint
CREATE INDEX "entities_rank_total_idx" ON "entities" USING btree (("total_commits" + coalesce("total_issues", 0) + coalesce("total_pull_requests", 0) + coalesce("total_reviews", 0) + coalesce("total_repos", 0) + "total_restricted") desc,"id") WHERE "entities"."kind" = 'user' and "entities"."suspended_at" is null and "entities"."built_at" is not null;--> statement-breakpoint
CREATE INDEX "entities_org_rank_commits_idx" ON "entities" USING btree ("total_commits" DESC NULLS FIRST,"id") WHERE "entities"."kind" = 'org' and "entities"."suspended_at" is null and "entities"."built_at" is not null;--> statement-breakpoint
CREATE INDEX "lookups_searched_at_idx" ON "lookups" USING btree ("searched_at" DESC NULLS FIRST);--> statement-breakpoint
CREATE INDEX "org_members_org_commits_idx" ON "org_members" USING btree ("org_id","commits" DESC NULLS FIRST,"member_id") WHERE "org_members"."last_fetched" is not null;
Loading