Skip to content

MariaDb: Slow Sql Query from notification table #32491

Closed
@sebastian-sauer

Description

@sebastian-sauer

Description

We get nearly every 30seconds the following slow query log in our log files:

...ties/notification.go:296:GetUIDsAndNotificationCounts() [W] [Slow SQL Query] SELECT user_id, sum(case when status= ? then 1 else 0 end) AS count FROM notification WHERE user_id IN (SELECT user_id FROM notification WHERE updated_unix >= ? AND updated_unix < ?) GROUP BY user_id [1 1731479575 1731479585] - 8.191264092s

Gitea Version

1.22.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Binary

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