Skip to content

Commit fc5ab21

Browse files
authored
Merge pull request #711 from NatLabRockies/admin-login-perf
Improve admin login performance
2 parents bdda392 + fc52a3c commit fc5ab21

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

db/schema.sql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1981,6 +1981,13 @@ CREATE INDEX api_users_api_key_prefix_search_idx ON api_umbrella.api_users USING
19811981
CREATE INDEX api_users_created_at_idx ON api_umbrella.api_users USING btree (created_at DESC);
19821982

19831983

1984+
--
1985+
-- Name: api_users_email_created_at_idx; Type: INDEX; Schema: api_umbrella; Owner: -
1986+
--
1987+
1988+
CREATE INDEX api_users_email_created_at_idx ON api_umbrella.api_users USING btree (email, created_at);
1989+
1990+
19841991
--
19851992
-- Name: api_users_roles_api_user_id_api_role_id_idx; Type: INDEX; Schema: api_umbrella; Owner: -
19861993
--
@@ -2826,3 +2833,4 @@ INSERT INTO api_umbrella.lapis_migrations (name) VALUES ('1738353016');
28262833
INSERT INTO api_umbrella.lapis_migrations (name) VALUES ('1753472899');
28272834
INSERT INTO api_umbrella.lapis_migrations (name) VALUES ('1769633747');
28282835
INSERT INTO api_umbrella.lapis_migrations (name) VALUES ('1769732670');
2836+
INSERT INTO api_umbrella.lapis_migrations (name) VALUES ('1775265493');

src/migrations.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,4 +1586,10 @@ return {
15861586
db.query(grants_sql)
15871587
db.query("COMMIT")
15881588
end,
1589+
1590+
[1775265493] = function()
1591+
db.query("CREATE INDEX CONCURRENTLY api_users_email_created_at_idx ON api_umbrella.api_users USING btree (email, created_at ASC)")
1592+
1593+
db.query(grants_sql)
1594+
end,
15891595
}

0 commit comments

Comments
 (0)