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

Connections page takes unusually long to load #20

Open
Chief-Engineer opened this issue Sep 7, 2023 · 4 comments
Open

Connections page takes unusually long to load #20

Chief-Engineer opened this issue Sep 7, 2023 · 4 comments

Comments

@Chief-Engineer
Copy link

Julian said it might be the results count taking a bit, which sounded like the likely cause, but I found out later that it's also about the same when doing a search with only a few results so it might be something else. I'm not sure what indexes the table has so maybe the long search time is a separate thing

@PJB3005
Copy link
Member

PJB3005 commented Jan 11, 2024

It's getting the result count having to do a full table scan over a 5-million row table.

Julian said it might be the results count taking a bit, which sounded like the likely cause, but I found out later that it's also about the same when doing a search with only a few results so it might be something else.

The reason fetching result count is expensive is that, in Postgres, fetching result count requires a full table scan. The only index on the table is for user ID, so searching anything else also has to do a full table scan.

@Chief-Engineer
Copy link
Author

pain. Is the solution then to remove result count when there is no filtering done, and to add a bunch of indexes?

@juliangiebel
Copy link
Contributor

juliangiebel commented Jan 11, 2024

You can also use the count estimate postgres has stored in the meta table to get at least a rough estimation of the result count when not filtering.
Indexes for filterable fields helps with performance when filtering yea

@PJB3005
Copy link
Member

PJB3005 commented Jan 12, 2024

Realistically we should also just be more serious about removing old connection logs. And we should fix it so people don't spam connections if the server is full, bloating the table.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🔖 Defined
Development

No branches or pull requests

3 participants