| Actor | Fragment | Worker | State |
|---|---|---|---|
| 736628 | 51745 | 51 | running |
| 736629 | 51745 | 51 | running |
| 736630 | 51747 | 51 | running |
| 736631 | 51747 | 51 | running |
| 736632 | 51748 | 51 | running |
| 736633 | 51748 | 51 | running |
| 736638 | 51750 | 51 | running |
| 736639 | 51750 | 51 | running |
| 736640 | 51753 | 51 | running |
| 736641 | 51753 | 51 | running |
| 736642 | 51749 | 51 | running |
| 736643 | 51749 | 51 | 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 FOR SYSTEM_TIME AS OF PROCTIME() 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