-
-
Notifications
You must be signed in to change notification settings - Fork 889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Addressing slow profile queries. #2777 #2830
Conversation
src/scheduled_tasks.rs
Outdated
@@ -122,6 +122,11 @@ fn update_banned_when_expired(conn: &mut PgConnection) { | |||
sql_query(update_ban_expires_stmt) | |||
.execute(conn) | |||
.expect("update banned when expires"); | |||
|
|||
let delete_community_ban_expires_stmt = "delete from community_person_ban where expires < now()"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than checking the community_person_ban.expires
column every time, I correctly delete the rows which are expired anyway in this scheduled job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, you can do the same for site bans. Btw why are queries in this file all written as plain strings and not using dsl?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, I fixed the ones that I could.
@@ -3,4 +3,4 @@ set -e | |||
|
|||
mkdir -p volumes/pictrs | |||
sudo chown -R 991:991 volumes/pictrs | |||
sudo docker-compose up -d --build | |||
sudo docker compose up -d --build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a mistake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docker is now bundling compose , and this is the new preferred way anyway.
065ad93
to
e7ab241
Compare
This is an attempt to work through a few of the issues dealing with slow profile queries. It doesn't solve all the issues, because the
post_view
andcomment_view
queries are unavoidably terrible... and I can't get them any better than~60ms
on average. They really need the eyes of a SQL expert to speed up past that.I'll address the main changes in the comments.