| Actor | Fragment | Worker | State |
|---|---|---|---|
| 117655 | 24785 | 26 | running |
| 117656 | 24785 | 26 | running |
| 117657 | 24786 | 26 | running |
| 117658 | 24786 | 26 | running |
| 117659 | 24787 | 26 | running |
| 117660 | 24787 | 26 | running |
| 117661 | 24790 | 26 | running |
| 117662 | 24791 | 26 | running |
| 117663 | 24792 | 26 | running |
| 117664 | 24792 | 26 | running |
| 117665 | 24789 | 26 | running |
| 117666 | 24789 | 26 | running |
CREATE MATERIALIZED VIEW authz.active_parties_to_portfolios_mv
WITH (
backfill_order=FIXED(party.customer_relationships -> olap.party_involvements_dm)
) AS
SELECT
inv.party_id,
inv.entity_id AS portfolio_id
FROM (
SELECT
party_id,
customer_relationship_id,
entity_id
FROM olap.party_involvements_dm
WHERE
entity_type = 'PORTFOLIO'
AND involvement_type = 'PORTFOLIO_HOLDER'
AND status = 'ACTIVE'
AND disabled_at IS NULL
AND effective_from <= CURRENT_TIMESTAMP
AND (
effective_to IS NULL OR effective_to > CURRENT_TIMESTAMP
)
) AS inv
JOIN party.customer_relationships AS cr
ON cr.id = inv.customer_relationship_id
AND cr.type = 'CUSTOMER'
AND cr.status = 'ACTIVE'
AND cr.disabled_at IS NULL
GROUP BY
inv.party_id,
inv.entity_id