-
Notifications
You must be signed in to change notification settings - Fork 28
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
Comments
It's getting the result count having to do a full table scan over a 5-million row table.
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. |
pain. Is the solution then to remove result count when there is no filtering done, and to add a bunch of indexes? |
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. |
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. |
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
The text was updated successfully, but these errors were encountered: