-
-
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
improve possible performance bottleneck #28547
Conversation
Can't you just join the repository table to that query and get rid of the iteration? |
Replace go-gitea#28500 --------- Co-authored-by: Giteabot <teabot@gitea.io>
* giteaofficial/main: Add more ways to try (go-gitea#28581) Convert to url auth to header auth in tests (go-gitea#28484) Fix 500 error of searching commits (go-gitea#28576) improve possible performance bottleneck (go-gitea#28547) Use information from previous blame parts (go-gitea#28572) Make offline mode as default to no connect external avatar service by default (go-gitea#28548) Fix merging artifact chunks error when minio storage basepath is set (go-gitea#28555) feat: bump `dessant/lock-threads` and `actions/setup-go` to use nodejs20 runtime (go-gitea#28565) Update actions document about comparsion as Github Actions (go-gitea#28560) Fix inperformant query on retrifing review from database. (go-gitea#28552) Fix the issue ref rendering for wiki (go-gitea#28556) Add missing head of lfs client batch (go-gitea#28550) [skip ci] Updated translations via Crowdin Remove deadcode under models/issues (go-gitea#28536) Always enable caches (go-gitea#28527) Improve ObjectFormat interface (go-gitea#28496)
Just adding here a quote from the Forgejo fix at #28500
We noticed that you apparently did not make a special case for SQLite, which likely breaks support for this database as per this PR.Test coverage for this part is not enough, thus not detected, I assume. Maybe I'm completely blind, but can you explain how the PR is supposed to work with SQLite? |
Acorrding to the https://www.sqlite.org/lang_update.html, sqlite supports |
Okay, maybe I confused it with DELETE and JOIN, sorry for bothering in this case. Did you check whether it works or not, so we don't attempt to fix bugs that don't actually exist? There is no automated testing for this one, and creating a test case with migrations wasn't trivial. I did not yet spend time on it. |
Yes, I will send a PR with tests for it. |
Replace go-gitea#28500 --------- Co-authored-by: Giteabot <teabot@gitea.io>
This reverts commit b35d3fd.
I will send a revert first and then try to send a new PR. #28593 |
…-gitea#28593) This reverts commit b35d3fd. This is totally wrong. I think `Update join` hasn't been supported well by xorm. I just revert the PR and will try to send another one.
* giteaofficial/main: Added instance-level variables (go-gitea#28115) Revert "improve possible performance bottleneck (go-gitea#28547)" (go-gitea#28593) [skip ci] Updated licenses and gitignores Fix flex container width (go-gitea#28603) Fix the scroll behavior for emoji/mention list (go-gitea#28597) bump to use alpine3.19 (go-gitea#28594) Include heap pprof in diagnosis report to help debugging memory leaks (go-gitea#28596) Disable query token param in integration tests (go-gitea#28592) Fix wrong due date rendering in issue list page (go-gitea#28588) Fix `status_check_contexts` matching bug (go-gitea#28582) Fix 405 method not allowed CORS / OIDC (go-gitea#28583)
…rted databases (#28590) Fix #28547 (comment) Since https://gitea.com/xorm/xorm/pulls/2383 merged, xorm now supports UPDATE JOIN. To keep consistent from different databases, xorm use `engine.Join().Update`, but the actural generated SQL are different between different databases. For MySQL, it's `UPDATE talbe1 JOIN table2 ON join_conditions SET xxx Where xxx`. For MSSQL, it's `UPDATE table1 SET xxx FROM TABLE1, TABLE2 WHERE join_conditions`. For SQLITE per https://www.sqlite.org/lang_update.html, sqlite support `UPDATE table1 SET xxx FROM table2 WHERE join conditions` from 3.33.0(2020-8-14). POSTGRES is the same as SQLITE.
…rted databases (go-gitea#28590) Fix go-gitea#28547 (comment) Since https://gitea.com/xorm/xorm/pulls/2383 merged, xorm now supports UPDATE JOIN. To keep consistent from different databases, xorm use `engine.Join().Update`, but the actural generated SQL are different between different databases. For MySQL, it's `UPDATE talbe1 JOIN table2 ON join_conditions SET xxx Where xxx`. For MSSQL, it's `UPDATE table1 SET xxx FROM TABLE1, TABLE2 WHERE join_conditions`. For SQLITE per https://www.sqlite.org/lang_update.html, sqlite support `UPDATE table1 SET xxx FROM table2 WHERE join conditions` from 3.33.0(2020-8-14). POSTGRES is the same as SQLITE.
…rted databases (#28590) (#28668) Backport #28590 by @lunny Fix #28547 (comment) Since https://gitea.com/xorm/xorm/pulls/2383 merged, xorm now supports UPDATE JOIN. To keep consistent from different databases, xorm use `engine.Join().Update`, but the actural generated SQL are different between different databases. For MySQL, it's `UPDATE talbe1 JOIN table2 ON join_conditions SET xxx Where xxx`. For MSSQL, it's `UPDATE table1 SET xxx FROM TABLE1, TABLE2 WHERE join_conditions`. For SQLITE per https://www.sqlite.org/lang_update.html, sqlite support `UPDATE table1 SET xxx FROM table2 WHERE join conditions` from 3.33.0(2020-8-14). POSTGRES is the same as SQLITE. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
…rted databases (#28590) (#28668) Backport #28590 by @lunny Fix go-gitea/gitea#28547 (comment) Since https://gitea.com/xorm/xorm/pulls/2383 merged, xorm now supports UPDATE JOIN. To keep consistent from different databases, xorm use `engine.Join().Update`, but the actural generated SQL are different between different databases. For MySQL, it's `UPDATE talbe1 JOIN table2 ON join_conditions SET xxx Where xxx`. For MSSQL, it's `UPDATE table1 SET xxx FROM TABLE1, TABLE2 WHERE join_conditions`. For SQLITE per https://www.sqlite.org/lang_update.html, sqlite support `UPDATE table1 SET xxx FROM table2 WHERE join conditions` from 3.33.0(2020-8-14). POSTGRES is the same as SQLITE. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> (cherry picked from commit 18da3f8)
Replace go-gitea#28500 --------- Co-authored-by: Giteabot <teabot@gitea.io>
…-gitea#28593) This reverts commit b35d3fd. This is totally wrong. I think `Update join` hasn't been supported well by xorm. I just revert the PR and will try to send another one.
…rted databases (go-gitea#28590) Fix go-gitea#28547 (comment) Since https://gitea.com/xorm/xorm/pulls/2383 merged, xorm now supports UPDATE JOIN. To keep consistent from different databases, xorm use `engine.Join().Update`, but the actural generated SQL are different between different databases. For MySQL, it's `UPDATE talbe1 JOIN table2 ON join_conditions SET xxx Where xxx`. For MSSQL, it's `UPDATE table1 SET xxx FROM TABLE1, TABLE2 WHERE join_conditions`. For SQLITE per https://www.sqlite.org/lang_update.html, sqlite support `UPDATE table1 SET xxx FROM table2 WHERE join conditions` from 3.33.0(2020-8-14). POSTGRES is the same as SQLITE.
Replace go-gitea#28500 --------- Co-authored-by: Giteabot <teabot@gitea.io>
…-gitea#28593) This reverts commit b35d3fd. This is totally wrong. I think `Update join` hasn't been supported well by xorm. I just revert the PR and will try to send another one.
…rted databases (go-gitea#28590) Fix go-gitea#28547 (comment) Since https://gitea.com/xorm/xorm/pulls/2383 merged, xorm now supports UPDATE JOIN. To keep consistent from different databases, xorm use `engine.Join().Update`, but the actural generated SQL are different between different databases. For MySQL, it's `UPDATE talbe1 JOIN table2 ON join_conditions SET xxx Where xxx`. For MSSQL, it's `UPDATE table1 SET xxx FROM TABLE1, TABLE2 WHERE join_conditions`. For SQLITE per https://www.sqlite.org/lang_update.html, sqlite support `UPDATE table1 SET xxx FROM table2 WHERE join conditions` from 3.33.0(2020-8-14). POSTGRES is the same as SQLITE.
Replace #28500