Skip to content

Commit

Permalink
Add database indices to frequent queries (#130)
Browse files Browse the repository at this point in the history
* Add database indices

Based on review of WHERE clauses in DAO queries

Partially address recent downtime issue due to DB connection pool saturation

* Update version in updates.sql to next release

---------

Co-authored-by: Lukas Forer <[email protected]>
  • Loading branch information
abought and lukfor authored Jan 24, 2024
1 parent ded71da commit 674c8da
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/sql/updates.sql
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,12 @@ alter table job add column user_agent VARCHAR (400);


-- 2.6.0
alter table `user` add column api_token_expires_on timestamp null default null;
alter table `user` add column api_token_expires_on timestamp null default null;

-- 2.8.1
CREATE INDEX idx_downloads_hash ON downloads(hash);
CREATE INDEX idx_downloads_path ON downloads(path);

CREATE INDEX idx_user_username ON user(username);
CREATE INDEX idx_user_mail ON user(mail);
CREATE INDEX idx_user_fullname ON user(full_name);

0 comments on commit 674c8da

Please sign in to comment.