mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-18 05:47:32 +00:00
8e2c3b671f
fix(query): optimize instance by domain query On zitadel cloud we noticed an increase in database CPU usage and slightly higher response times. By analyzes we found that the instance by domain query was wrongly joining all instance_feature rows against all instances. This PR adds an additional CTE to limit the join set to only the features that apply to the found instance. The query was introduced with https://github.com/zitadel/zitadel/pull/7356 and part of the v2.47 release. (cherry picked from commit 3af28d29d25b9f396c6129ad8d248df4cc3af8dc)