| Actor | Fragment | Worker | State |
|---|---|---|---|
| 737135 | 52100 | 51 | running |
| 737136 | 52100 | 51 | running |
| 737137 | 52103 | 51 | running |
| 737138 | 52103 | 51 | running |
| 737175 | 52097 | 51 | running |
| 737176 | 52097 | 51 | running |
| 737179 | 52099 | 51 | running |
| 737180 | 52099 | 51 | running |
| 737181 | 52098 | 51 | running |
| 737182 | 52098 | 51 | running |
| 737183 | 52101 | 51 | running |
| 737184 | 52101 | 51 | running |
CREATE MATERIALIZED VIEW search.party_holder_edges_mv
WITH (
backfill_order=FIXED(party.customer_relationships -> olap.party_involvements_dm)
) AS
SELECT
inv.party_id,
inv.entity_id,
'account' AS entity_type
FROM (
SELECT
party_id,
customer_relationship_id,
entity_id
FROM olap.party_involvements_dm
WHERE
entity_type = 'ACCOUNT'
AND involvement_type = 'ACCOUNT_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 search.active_parties_mv AS p
ON p.id = inv.party_id
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
JOIN olap.accounts_dm AS a
ON a.account_id = inv.entity_id AND a.disabled_at IS NULL
UNION ALL
SELECT
inv.party_id,
inv.entity_id,
'portfolio'
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 search.active_parties_mv AS p
ON p.id = inv.party_id
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
JOIN olap.portfolios_dm AS port
ON port.portfolio_id = inv.entity_id AND port.disabled_at IS NULL