-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Performance issue when viewing all packages of an organisation #28255
Comments
|
Hi @lunny, as stated above |
Could you please check if the queries use indices? All used fields should be covered but maybe we need a combined index. |
When moving the condition So instead of exec sp_executesql N'SELECT * FROM [package_version] LEFT JOIN [package_version] [pv2] ON (package_version.package_id = pv2.package_id AND (package_version.created_unix < pv2.created_unix OR (package_version.created_unix = pv2.created_unix AND package_version.id < pv2.id))) AND pv2.is_internal=@p1 INNER JOIN [package] ON package.id = package_version.package_id WHERE package_version.is_internal=@p2 AND package.owner_id=@p3 AND (pv2.id IS NULL) ORDER BY [package_version].[created_unix] DESC OFFSET 0 ROWS FETCH NEXT 20 ROWS ONLY',N'@p1 bit,@p2 bit,@p3 bigint',@p1=0,@p2=0,@p3=2 I executed this one: exec sp_executesql N'SELECT * FROM [package_version] LEFT JOIN [package_version] [pv2] ON (package_version.package_id = pv2.package_id AND (package_version.created_unix < pv2.created_unix OR (package_version.created_unix = pv2.created_unix AND package_version.id < pv2.id))) AND pv2.is_internal=@p1 AND (pv2.id IS NULL) INNER JOIN [package] ON package.id = package_version.package_id WHERE package_version.is_internal=@p2 AND package.owner_id=@p3 ORDER BY [package_version].[created_unix] DESC OFFSET 0 ROWS FETCH NEXT 20 ROWS ONLY',N'@p1 bit,@p2 bit,@p3 bigint',@p1=0,@p2=0,@p3=2 |
Immer doch! 😄
That should just produce a fast Could you provide screenshots from mouse-hovering the "Parallelität" blocks? |
If you add looks like query gets latest package versions. Not so good design to handle large amount of data. |
@Mik4sa Could you please test how fast/slow this query is? |
Yes, the query is fast, under 1 second. Also, you search for the latest package version by id as it seems. Should we change this so that a date is used? I mean, what if the ids get reused some day for example? |
@KN4CK3R |
@KN4CK3R Still no update? I thought we get this done very fast. It felt so when you were first replying. |
I will do some investigations. |
Sorry, didn't published my changes back then. Created #30520. |
Fixes go-gitea#28255 The new query uses the id field to sort by "newer". This most not be correct (usually it is) but it's faster (see go-gitea#28255). If someone has a better idea, please propose changes. Co-authored-by: Giteabot <teabot@gitea.io>
Description
In addition to #25953 there is atleast on more very slow scenario for a very lot of packages when viewing all packages of an organisation. The total time was about 4m.
I discovered atleast two very slow queries:
and
The first one run 2m46s and the second one 1m20s.
There might be more slow queries.
I'm happy to help and execute queries for test if necessary
Gitea Version
Gitea version 1.21.1 built with GNU Make 4.3, go1.21.4 : bindata, sqlite, sqlite_unlock_notify
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
git version 2.39.1.windows.1
Operating System
Windows Server 2016 - Version 1607 (Build 14393.6452)
How are you running Gitea?
gitea-1.21.1-windows-4.0-amd64.exe
from your download pageD:\gitea\gitea.exe web --config D:\gitea\custom\conf\app.ini
Database
MSSQL
The text was updated successfully, but these errors were encountered: