| Actor | Fragment | Worker | State |
|---|---|---|---|
| 744253 | 62715 | 51 | running |
| 744254 | 62715 | 51 | running |
| 744255 | 62717 | 51 | running |
| 744256 | 62717 | 51 | running |
| 744257 | 62716 | 51 | running |
| 744258 | 62716 | 51 | running |
| 744259 | 62719 | 51 | running |
| 744260 | 62719 | 51 | running |
| 744261 | 62720 | 51 | running |
| 744262 | 62720 | 51 | running |
| 744263 | 62722 | 51 | running |
| 744264 | 62722 | 51 | running |
CREATE MATERIALIZED VIEW search.party_holder_edges_mv
WITH (
backfill_order=FIXED(party.customer_relationships_next -> 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