Skip to content

Slow loading of dashboard view #32858

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

Closed
5pr1nz opened this issue Dec 15, 2024 · 2 comments
Closed

Slow loading of dashboard view #32858

5pr1nz opened this issue Dec 15, 2024 · 2 comments
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail

Comments

@5pr1nz
Copy link

5pr1nz commented Dec 15, 2024

Description

When loading the dashboad for a logged in user (i.e. GET /) the response time is quite high at about two to four seconds.

2024/12/15 22:49:32 ...eb/routing/logger.go:102:func1() [I] router: completed GET / for 172.13.37.42:0, 200 OK in 2266.2ms @ web/home.go:32(web.Home)

The reason is one query that is not using an index.

# Time: 241216  0:09:48
# User@Host: gitea[gitea] @ localhost [127.0.0.1]
# Thread_id: 40  Schema: giteadb  QC_hit: No
# Query_time: 1.632164  Lock_time: 0.000037  Rows_sent: 1  Rows_examined: 29547
# Rows_affected: 0  Bytes_sent: 0
SET timestamp=1734304188;
SELECT count(*) FROM `action` WHERE user_id=1337 AND is_deleted=0;

All other queries are very fast and there are no complaints about response times.

After introducing a new index, the problem is resolved.

CREATE INDEX IDX_action_r2_u_d ON action (`user_id`, `is_deleted`);

The dashboard loads now within 250 ms.

Gitea Version

1.22.5, 1.22.6

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

1.22.6

Operating System

Debian 12

How are you running Gitea?

  • Self hosted Gitea instance, 8 GB Memory and NVMe storage
  • mariadb Ver 15.1 Distrib 10.11.6-MariaDB

Database

MySQL/MariaDB

@lunny
Copy link
Member

lunny commented Dec 15, 2024

Thank you for your report. This has been fixed by #32333. The approach is the same as you. v1.23.0-rc0 will be released very soon. Since it will migrate the database, so that cannot be backported to v1.22.

@lunny lunny added issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail and removed type/bug labels Dec 15, 2024
@GiteaBot
Copy link
Collaborator

We close issues that need feedback from the author if there were no new comments for a month. 🍵

@go-gitea go-gitea locked as resolved and limited conversation to collaborators Apr 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail
Projects
None yet
Development

No branches or pull requests

3 participants