From c4fa9a0975e16a921f31985e4119a4669d40714f Mon Sep 17 00:00:00 2001 From: Marco Ardizzone Date: Fri, 8 Aug 2025 10:46:47 +0200 Subject: [PATCH] sql: Add indices by key and key+value for user metas projection --- internal/query/projection/user_metadata.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/query/projection/user_metadata.go b/internal/query/projection/user_metadata.go index 6de98ad73e..eb5af0ef48 100644 --- a/internal/query/projection/user_metadata.go +++ b/internal/query/projection/user_metadata.go @@ -49,6 +49,9 @@ func (*userMetadataProjection) Init() *old_handler.Check { }, handler.NewPrimaryKey(UserMetadataColumnInstanceID, UserMetadataColumnUserID, UserMetadataColumnKey), handler.WithIndex(handler.NewIndex("resource_owner", []string{UserGrantResourceOwner})), + handler.WithIndex(handler.NewIndex("metadata_key", []string{UserMetadataColumnKey})), + handler.WithIndex(handler.NewIndex("metadata_value", []string{UserMetadataColumnValue})), + handler.WithIndex(handler.NewIndex("metadata_key_and_value", []string{UserMetadataColumnKey, UserMetadataColumnValue})), ), ) }