Skip to content
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

Add index on BaseTarget.created to speed up load time of large DBs #1173

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

Fingel
Copy link
Contributor

@Fingel Fingel commented Feb 5, 2025

We currently sort on the created field of BaseTarget, which causes performance issues when there are a large number of BaseTargets.

In a database with 6 million rows, this reduced the time for the SQL SELECT from ~800ms to less than 1ms, significantly speeding up page load time.

Note that this does NOT solve #598 but it does help a little.

No index:
Screenshot From 2025-02-05 13-58-41

With index:
image

We currently sort on the created field of BaseTarget, which causes
performance issues when there are a large number of BaseTargets.

In a database with 6 million rows, this reduced the time for the SQL
count(*) from ~800ms to ~100ms, significantly speeding up page load
time.

Note that this does NOT solve #598 but it does help a little.
@Fingel Fingel requested review from phycodurus and jchate6 February 5, 2025 22:05
@Fingel Fingel linked an issue Feb 5, 2025 that may be closed by this pull request
Copy link
Contributor

@jchate6 jchate6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure this is what I did to make the home page accessible.
But yeah, it doesn't totally solve the problem.

@Fingel Fingel merged commit 7cc7619 into dev Feb 6, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Released
Development

Successfully merging this pull request may close these issues.

TargetList load time for non-superusers
2 participants