mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:47:32 +00:00
fix: improve performance by reducing full table scans (#4684)
* use instance id on update in projections * create index on domain in instance_domain projection * add missing instanceID filter to app queries
This commit is contained in:
@@ -312,6 +312,7 @@ func (p *labelPolicyProjection) reduceChanged(event eventstore.Event) (*handler.
|
||||
[]handler.Condition{
|
||||
handler.NewCond(LabelPolicyIDCol, policyEvent.Aggregate().ID),
|
||||
handler.NewCond(LabelPolicyStateCol, domain.LabelPolicyStatePreview),
|
||||
handler.NewCond(LabelPolicyInstanceIDCol, event.Aggregate().InstanceID),
|
||||
}), nil
|
||||
}
|
||||
|
||||
@@ -324,6 +325,7 @@ func (p *labelPolicyProjection) reduceRemoved(event eventstore.Event) (*handler.
|
||||
policyEvent,
|
||||
[]handler.Condition{
|
||||
handler.NewCond(LabelPolicyIDCol, policyEvent.Aggregate().ID),
|
||||
handler.NewCond(LabelPolicyInstanceIDCol, event.Aggregate().InstanceID),
|
||||
}), nil
|
||||
}
|
||||
|
||||
@@ -425,6 +427,7 @@ func (p *labelPolicyProjection) reduceLogoAdded(event eventstore.Event) (*handle
|
||||
[]handler.Condition{
|
||||
handler.NewCond(LabelPolicyIDCol, event.Aggregate().ID),
|
||||
handler.NewCond(LabelPolicyStateCol, domain.LabelPolicyStatePreview),
|
||||
handler.NewCond(LabelPolicyInstanceIDCol, event.Aggregate().InstanceID),
|
||||
}), nil
|
||||
}
|
||||
|
||||
@@ -453,6 +456,7 @@ func (p *labelPolicyProjection) reduceLogoRemoved(event eventstore.Event) (*hand
|
||||
[]handler.Condition{
|
||||
handler.NewCond(LabelPolicyIDCol, event.Aggregate().ID),
|
||||
handler.NewCond(LabelPolicyStateCol, domain.LabelPolicyStatePreview),
|
||||
handler.NewCond(LabelPolicyInstanceIDCol, event.Aggregate().InstanceID),
|
||||
}), nil
|
||||
}
|
||||
|
||||
@@ -481,6 +485,7 @@ func (p *labelPolicyProjection) reduceIconAdded(event eventstore.Event) (*handle
|
||||
[]handler.Condition{
|
||||
handler.NewCond(LabelPolicyIDCol, event.Aggregate().ID),
|
||||
handler.NewCond(LabelPolicyStateCol, domain.LabelPolicyStatePreview),
|
||||
handler.NewCond(LabelPolicyInstanceIDCol, event.Aggregate().InstanceID),
|
||||
}), nil
|
||||
}
|
||||
|
||||
@@ -509,6 +514,7 @@ func (p *labelPolicyProjection) reduceIconRemoved(event eventstore.Event) (*hand
|
||||
[]handler.Condition{
|
||||
handler.NewCond(LabelPolicyIDCol, event.Aggregate().ID),
|
||||
handler.NewCond(LabelPolicyStateCol, domain.LabelPolicyStatePreview),
|
||||
handler.NewCond(LabelPolicyInstanceIDCol, event.Aggregate().InstanceID),
|
||||
}), nil
|
||||
}
|
||||
|
||||
@@ -533,6 +539,7 @@ func (p *labelPolicyProjection) reduceFontAdded(event eventstore.Event) (*handle
|
||||
[]handler.Condition{
|
||||
handler.NewCond(LabelPolicyIDCol, event.Aggregate().ID),
|
||||
handler.NewCond(LabelPolicyStateCol, domain.LabelPolicyStatePreview),
|
||||
handler.NewCond(LabelPolicyInstanceIDCol, event.Aggregate().InstanceID),
|
||||
}), nil
|
||||
}
|
||||
|
||||
@@ -557,6 +564,7 @@ func (p *labelPolicyProjection) reduceFontRemoved(event eventstore.Event) (*hand
|
||||
[]handler.Condition{
|
||||
handler.NewCond(LabelPolicyIDCol, event.Aggregate().ID),
|
||||
handler.NewCond(LabelPolicyStateCol, domain.LabelPolicyStatePreview),
|
||||
handler.NewCond(LabelPolicyInstanceIDCol, event.Aggregate().InstanceID),
|
||||
}), nil
|
||||
}
|
||||
|
||||
@@ -582,5 +590,6 @@ func (p *labelPolicyProjection) reduceAssetsRemoved(event eventstore.Event) (*ha
|
||||
[]handler.Condition{
|
||||
handler.NewCond(LabelPolicyIDCol, event.Aggregate().ID),
|
||||
handler.NewCond(LabelPolicyStateCol, domain.LabelPolicyStatePreview),
|
||||
handler.NewCond(LabelPolicyInstanceIDCol, event.Aggregate().InstanceID),
|
||||
}), nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user