| Actor | Fragment | Worker | State |
|---|---|---|---|
| 745629 | 63199 | 51 | running |
| 745630 | 63199 | 51 | running |
| 745631 | 63200 | 51 | running |
| 745632 | 63200 | 51 | running |
| 745674 | 63204 | 51 | running |
| 745675 | 63204 | 51 | running |
| 745676 | 63202 | 51 | running |
| 745677 | 63202 | 51 | running |
| 745678 | 63201 | 51 | running |
| 745679 | 63201 | 51 | running |
| 745688 | 63203 | 51 | running |
| 745689 | 63203 | 51 | running |
CREATE MATERIALIZED VIEW alinma_bff.party_advisor_kpi_user_accounts_mv AS
SELECT
user_accounts.user_id,
user_accounts.account_id,
MAX(user_accounts.updated_at) AS updated_at
FROM (
SELECT
uc.user_id,
pcm.account_id,
uc.updated_at
FROM alinma_bff.party_advisor_kpi_user_customers_mv AS uc
JOIN alinma_bff.party_current_account_membership_mv AS pcm
ON pcm.party_id = uc.party_id
AND pcm.customer_relationship_id = uc.customer_relationship_id
AND pcm.account_group_type = 'all'
UNION ALL
SELECT
up.user_id,
atp.account_id,
up.updated_at
FROM alinma_bff.party_advisor_kpi_direct_user_portfolios_mv AS up
JOIN olap.account_to_portfolios_dm AS atp
ON atp.portfolio_id = up.portfolio_id
AND atp.disabled_at IS NULL
AND atp.effective_end_date IS NULL
JOIN olap.accounts_dm AS a
ON a.account_id = atp.account_id AND a.closing_date IS NULL AND a.disabled_at IS NULL
) AS user_accounts
GROUP BY
user_accounts.user_id,
user_accounts.account_id