mirror of
https://github.com/zitadel/zitadel.git
synced 2025-03-01 16:27:37 +00:00

# Which Problems Are Solved get instance by domain cannot provide an instance id because it is not known at that time. This causes a full table scan on the fields table because current indexes always include the `instance_id` column. # How the Problems Are Solved Added a specific index for this query. # Additional Context If a system has many fields and there is no cache hit for the given domain this query can heaviuly influence database CPU usage, the newly added resolves this problem.
3 lines
187 B
SQL
3 lines
187 B
SQL
CREATE INDEX CONCURRENTLY IF NOT EXISTS fields_instance_domains_idx
|
|
ON eventstore.fields (object_id) INCLUDE (instance_id)
|
|
WHERE object_type = 'instance_domain' AND field_name = 'domain'; |