mirror of
https://github.com/zitadel/zitadel.git
synced 2025-07-14 12:58:31 +00:00
fix: add user id index on sessions8 (#9834)
# Which Problems Are Solved When a user changes their password, Zitadel needs to terminate all of that user's active sessions. This query can take many seconds on deployments with large session and user tables. This happens as part of session projection handling, so doesn't directly impact user experience, but potentially bogs down the projection handler which isn't great. In the future, this index could be used to power a "see all of my current sessions" feature in Zitadel. # How the Problems Are Solved Adds new index on `user_id` column on `projections.sessions8` table. Alternatively, we can index on `(instance_id, user_id)` instead but opted for keeping the index smaller as we already index on `instance_id` separately. # Additional Changes None # Additional Context None --------- Co-authored-by: Silvan <27845747+adlerhurst@users.noreply.github.com>
This commit is contained in:
parent
a626678004
commit
8cb1d24b36
@ -87,6 +87,7 @@ func (*sessionProjection) Init() *old_handler.Check {
|
||||
SessionColumnUserAgentFingerprintID+"_idx",
|
||||
[]string{SessionColumnUserAgentFingerprintID},
|
||||
)),
|
||||
handler.WithIndex(handler.NewIndex(SessionColumnUserID+"_idx", []string{SessionColumnUserID})),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user