-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Missing combined index on issue_user issue_id and uid #27877
Comments
Does XORM support combined Indexes? |
From docs https://xorm.io/docs/chapter-02/4.columns/
|
But I'm not sure how to handle the current case - there is already an index on both fields but no combined. |
@JakobDev yes, with the same mechanism as for composite unique keys as @KazzmanK already pointed out. |
Not sure i understand correctly - can i just use sth like the following code:
As i want to keep the index only on UID and add a combined index. |
Exactly. |
Great - will create a pr with that. |
If you need to keep UID index there is no need to have dedicated one, combined (UID,IssueID) index will support querying by UID alone. Just be sure, that XORM`s combined index will be created as (UID,IssueID), but not (IssueID,UID)
Other question, what if I need to have two combined indexes , (UID,IssueID) and (IssueID,UID), looks like it is not possible. |
Currently, xorm doesn't support index sequences. But more than one index is supported. |
fixes #27877 --------- Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
fixes go-gitea#27877 --------- Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
fixes go-gitea#27877 --------- Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Description
There is currently no combined index on issue_user uid and issueid.
For a lot of operations these two params are used in the where query and adding the index brought some noticeable performance benefits.
Gitea Version
1.20.5
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?
gitea executable
Database
MySQL/MariaDB
The text was updated successfully, but these errors were encountered: