| Actor | Fragment | Worker | State |
|---|---|---|---|
| 157580 | 12708 | 33 | running |
| 157581 | 12708 | 33 | running |
| 157582 | 12709 | 33 | running |
| 157583 | 12709 | 33 | running |
| 157680 | 12703 | 33 | running |
| 157681 | 12703 | 33 | running |
| 157682 | 12704 | 33 | running |
| 157683 | 12704 | 33 | running |
| 157684 | 12702 | 33 | running |
| 157685 | 12702 | 33 | running |
| 157686 | 12705 | 33 | running |
| 157687 | 12705 | 33 | running |
CREATE MATERIALIZED VIEW alpheya_experience_bff.account_owners_mv AS
SELECT
atc.account_id,
JSONB_AGG(
JSONB_BUILD_OBJECT(
'id',
c.id,
'displayName',
c.display_name,
'localDisplayName',
c.local_display_name,
'preferredName',
c.preferred_name,
'ownerType',
atc.owner_type
)
) AS owners,
CAST(COUNT(*) AS INT) AS owner_count
FROM olap.accounts_to_clients_dm AS atc
JOIN olap.clients_dm AS c
ON c.id = atc.client_id AND c.closing_date IS NULL
JOIN insights.open_accounts_mv AS oa
ON oa.account_id = atc.account_id
WHERE
atc.disabled_at IS NULL AND atc.effective_end_date IS NULL
GROUP BY
atc.account_id