RWM Console cluster: risingwave-adib.adib-rw.svc.cluster.local

← cluster insights objects party_account_via_portfolio_mv
Overview Objects Graph History
materialized view · insights.party_account_via_portfolio_mv Explain plan ▶
Parallelism
2
Actors
42 / 42
running
Distribution
HASH
Rows
0
State size
Created
2026-08-24 15:29
Initialized
2026-08-24 15:29
Fragment flags
MVIEWSNAPSHOT_BACKFILL_STREAM_SCANSTREAM_SCAN
Actors
ActorFragmentWorkerState
102561 23429 26 running
102562 23429 26 running
102563 23419 26 running
102564 23419 26 running
102565 23422 26 running
102566 23422 26 running
102567 23439 26 running
102568 23439 26 running
102569 23423 26 running
102570 23423 26 running
102571 23421 26 running
102572 23421 26 running
+ 30 more actor(s) (42 running)
sql · insights.party_account_via_portfolio_mv — click to expand
CREATE MATERIALIZED VIEW insights.party_account_via_portfolio_mv AS
WITH portfolio_mediated AS (
  SELECT
    ppi.party_id,
    ppi.customer_relationship_id,
    atp.account_id,
    GREATEST(atp.effective_start_date, ppi.effective_from) AS effective_start_date,
    CASE
      WHEN atp.effective_end_date IS NULL AND ppi.effective_to IS NULL
      THEN CAST(NULL AS DATE)
      WHEN atp.effective_end_date IS NULL
      THEN ppi.effective_to
      WHEN ppi.effective_to IS NULL
      THEN atp.effective_end_date
      ELSE LEAST(atp.effective_end_date, ppi.effective_to)
    END AS effective_end_date,
    oa.is_restricted
  FROM olap.account_to_portfolios_dm AS atp
  JOIN olap.party_involvements_dm AS ppi
    ON ppi.entity_id = atp.portfolio_id
    AND ppi.entity_type = 'PORTFOLIO'
    AND ppi.involvement_type IN ('PORTFOLIO_HOLDER', 'JOINT_PORTFOLIO_HOLDER')
    AND ppi.status = 'ACTIVE'
    AND ppi.disabled_at IS NULL
    AND (
      ppi.effective_to IS NULL OR ppi.effective_to > ppi.effective_from
    )
  JOIN insights.open_accounts_mv AS oa
    ON oa.account_id = atp.account_id
  JOIN party.customer_relationships AS cr
    ON cr.id = ppi.customer_relationship_id
    AND cr.type = 'CUSTOMER'
    AND cr.status = 'ACTIVE'
    AND cr.disabled_at IS NULL
  WHERE
    atp.disabled_at IS NULL
    AND (
      atp.effective_end_date IS NULL
      OR atp.effective_end_date > atp.effective_start_date
    )
    AND NOT EXISTS(
      SELECT
        1
      FROM olap.party_involvements_dm AS d
      JOIN party.customer_relationships AS dcr
        ON dcr.id = d.customer_relationship_id
        AND dcr.type = 'CUSTOMER'
        AND dcr.status = 'ACTIVE'
        AND dcr.disabled_at IS NULL
      WHERE
        d.entity_id = atp.account_id
        AND d.party_id = ppi.party_id
        AND d.entity_type = 'ACCOUNT'
        AND d.involvement_type IN ('ACCOUNT_HOLDER', 'JOINT_ACCOUNT_HOLDER')
        AND d.status = 'ACTIVE'
        AND d.disabled_at IS NULL
        AND (
          d.effective_to IS NULL OR d.effective_to > d.effective_from
        )
    )
)
SELECT
  party_id,
  customer_relationship_id,
  account_id,
  effective_start_date,
  effective_end_date,
  CAST('all' AS VARCHAR) AS type
FROM portfolio_mediated
WHERE
  effective_end_date IS NULL OR effective_start_date < effective_end_date
UNION ALL
SELECT
  party_id,
  customer_relationship_id,
  account_id,
  effective_start_date,
  effective_end_date,
  CAST(CASE WHEN is_restricted THEN 'restricted' ELSE 'un_restricted' END AS VARCHAR) AS type
FROM portfolio_mediated
WHERE
  effective_end_date IS NULL OR effective_start_date < effective_end_date
Lineage · insights.party_account_via_portfolio_mv 8 objects
Direct (1-hop) dependencies from rw_depend, across schemas. Click a neighbor to expand its dependencies; ⌘/Ctrl-click opens its page. Drag to pan, scroll to zoom. External source/sink endpoints (Kafka, Iceberg) are not shown.