| Actor | Fragment | Worker | State |
|---|---|---|---|
| 743127 | 37494 | 51 | running |
| 743128 | 37494 | 51 | running |
| 743369 | 37500 | 51 | running |
| 743370 | 37500 | 51 | running |
| 743373 | 37501 | 51 | running |
| 743374 | 37501 | 51 | running |
| 743405 | 37503 | 51 | running |
| 743406 | 37503 | 51 | running |
| 743407 | 37497 | 51 | running |
| 743408 | 37497 | 51 | running |
| 743409 | 37502 | 51 | running |
| 743410 | 37502 | 51 | 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