RWM Console cluster: risingwave-alinma.alinma-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
54 / 54
running
Distribution
HASH
Rows
2
State size
1002 Bytes
Created
2026-08-19 22:37
Initialized
2026-08-19 22:37
Fragment flags
LOCALITY_PROVIDERMVIEWSNAPSHOT_BACKFILL_STREAM_SCANSTREAM_SCAN
Actors
ActorFragmentWorkerState
737592 61043 51 running
737593 61043 51 running
737618 61047 51 running
737619 61047 51 running
737620 61046 51 running
737621 61046 51 running
737622 61045 51 running
737623 61045 51 running
737624 61069 51 running
737625 61069 51 running
737626 61044 51 running
737627 61044 51 running
+ 42 more actor(s) (54 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.