| Actor | Fragment | Worker | State |
|---|---|---|---|
| 32986 | 9810 | 33 | running |
| 32987 | 9810 | 33 | running |
| 32988 | 9816 | 33 | running |
| 32989 | 9816 | 33 | running |
| 32990 | 9815 | 33 | running |
| 32991 | 9815 | 33 | running |
| 32992 | 9812 | 33 | running |
| 32993 | 9812 | 33 | running |
| 32994 | 9811 | 33 | running |
| 32995 | 9811 | 33 | running |
| 33020 | 9813 | 33 | running |
| 33021 | 9813 | 33 | running |
CREATE MATERIALIZED VIEW insights.client_account_direct_mv AS
SELECT
atc.client_id,
atc.account_id,
atc.effective_start_date,
atc.effective_end_date,
CAST('all' AS VARCHAR) AS type
FROM olap.accounts_to_clients_dm AS atc
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
OR atc.effective_end_date > atc.effective_start_date
)
UNION ALL
SELECT
atc.client_id,
atc.account_id,
atc.effective_start_date,
atc.effective_end_date,
CAST('restricted' AS VARCHAR) AS type
FROM olap.accounts_to_clients_dm AS atc
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
OR atc.effective_end_date > atc.effective_start_date
)
AND oa.is_restricted = TRUE
UNION ALL
SELECT
atc.client_id,
atc.account_id,
atc.effective_start_date,
atc.effective_end_date,
CAST('un_restricted' AS VARCHAR) AS type
FROM olap.accounts_to_clients_dm AS atc
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
OR atc.effective_end_date > atc.effective_start_date
)
AND NOT oa.is_restricted IS TRUE