-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Improve admin dashboard summary display to prevent timeout #17506
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
Comments
Instead of these SELECT table_rows FROM information_schema.tables WHERE tables.table_name = ? AND tables.table_schema = ?; with the first parameter as the table name and the second param is the db name. Of course Postgres needs: SELECT reltuples AS estimate FROM pg_class WHERE relname = 'table_name'; SQLite it appears that COUNT is just the fastest available. MSSQL sp_spaceused 'Table_name` |
Currently whenever the prometheus metrics endpoint or `/admin` endpoint are viewed the statistics are recalculated immediately - using COUNT rather than a less expensive method. This PR provides a mechanism to cache these statistics, avoids generating all of the metrics on the admin page and provides an estimation method for the plain table counts. Fix go-gitea#17506 Signed-off-by: Andrew Thornton <[email protected]>
I have to say I suspect that getting the count for the Action table might be a false report - the real problems are if you have: [metrics]
ENABLED_ISSUE_BY_LABEL=true
ENABLED_ISSUE_BY_REPOSITORY=true Then all of that work occurs every time you look at the admin dashboard page. Thus we have to cache these statistics or remove these from the GetStatistics call. |
For the user (#17504), it's not a false report, after the user truncated their For me, it's not a false report. Now what I am doing is truncating my ps: other statistics also have performance problem, too, so caching them and moving them to a dedicated page are all good. |
Description
The Admin -> Dashboard -> Summary shows many counting numbers. Some of them aren't useful to admins. Even worse, some counting operations on the large tables like
action
will make the page timeout. For example:action
table #17504 , "Action table contains 8539538 rows", it takes several minutes to count.I suggest to improve the summary information, we shouldn't count so many models. Each number displayed here should be useful to admins.
The text was updated successfully, but these errors were encountered: