Skip to content

Slow loading Dashboard #33582

Closed
Closed
@rico132

Description

@rico132

Description

Hello there,

Loading the dashboard takes around 3 to 5 seconds. I found a query in the logs that takes over 1s to finish.
The query is from action_list.go:224:GetFeeds() :

SELECT count(*) FROM `action` WHERE act_user_id IN
        (SELECT `user`.id FROM `user` WHERE
            (keep_activity_private=? AND visibility IN (?,?)
            ) OR id=? OR
            (type=? AND `user`.id IN
                (SELECT org_id FROM team_user WHERE uid=?
                )
            )
        ) AND repo_id IN
        (SELECT id FROM repository WHERE
            (`repository`.is_private=? AND `repository`.owner_id NOT IN
                (SELECT id FROM `user` WHERE type=? AND visibility IN (?)
                )
            ) OR `repository`.id IN
                (SELECT repo_id FROM `access` WHERE `access`.user_id=? AND `access`.mode>?
                ) OR `repository`.id IN
                    (SELECT `team_repo`.repo_id FROM team_repo INNER JOIN team_user ON `team_user`.team_id = `team_repo`.team_id WHERE `team_user`.uid=?
                    ) OR `repository`.owner_id=? OR (`repository`.is_private=? AND `repository`.owner_id IN
                        (SELECT `org_user`.org_id FROM org_user WHERE `org_user`.uid=?
                        )
                )
        ) AND user_id=? AND is_deleted=?

As I am not familiar with SQL indexes, is there anything one can do to speed this up?

Gitea Version

1.23.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

Image

Git Version

No response

Operating System

No response

How are you running Gitea?

I am using Nomad's Docker driver to deploy gitea/gitea:1.23.3-rootless

Database

MySQL/MariaDB

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions