| Actor | Fragment | Worker | State |
|---|---|---|---|
| 736312 | 51849 | 51 | running |
| 736313 | 51849 | 51 | running |
| 736832 | 51858 | 51 | running |
| 736833 | 51858 | 51 | running |
| 736834 | 51850 | 51 | running |
| 736835 | 51850 | 51 | running |
| 736836 | 51852 | 51 | running |
| 736837 | 51852 | 51 | running |
| 736838 | 51853 | 51 | running |
| 736839 | 51853 | 51 | running |
| 736840 | 51851 | 51 | running |
| 736841 | 51851 | 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