| Actor | Fragment | Worker | State |
|---|---|---|---|
| 53405 | 2560 | 3 | running |
| 53406 | 2560 | 3 | running |
| 54172 | 2563 | 3 | running |
| 54173 | 2563 | 3 | running |
| 54174 | 2564 | 3 | running |
| 54175 | 2564 | 3 | running |
| 54176 | 2565 | 3 | running |
| 54177 | 2565 | 3 | running |
| 54178 | 2562 | 3 | running |
| 54179 | 2562 | 3 | running |
| 54180 | 2561 | 3 | running |
| 54181 | 2561 | 3 | 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