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

← cluster insights objects pnl_by_distribution_mv
Overview Objects Graph History
materialized view · insights.pnl_by_distribution_mv Explain plan ▶
Parallelism
2
Actors
8 / 8
running
Distribution
HASH
Rows
2,758,381
State size
1.4 GiB
Created
2026-08-19 23:12
Initialized
2026-08-19 23:11
Fragment flags
LOCALITY_PROVIDERMVIEWSNAPSHOT_BACKFILL_STREAM_SCANSTREAM_SCAN
Actors
ActorFragmentWorkerState
740565 62026 51 running
740566 62026 51 running
740571 62027 51 running
740572 62027 51 running
740881 62028 51 running
740882 62028 51 running
740883 62029 51 running
740884 62029 51 running
sql · insights.pnl_by_distribution_mv — click to expand
CREATE MATERIALIZED VIEW insights.pnl_by_distribution_mv AS
SELECT
  b.account_group_id,
  b.dim_balance_date,
  b.position_type,
  b.distribution_type,
  b.taxonomy_node_id,
  b.taxonomy_code,
  b.currency_code,
  b.market_value,
  b.total_average_cost,
  b.fair_value,
  b.market_value_system_currency,
  b.total_average_cost_system_currency,
  b.fair_value_system_currency,
  COALESCE(cn.cumulative_adjusted_netflow, 0) AS cumulative_adjusted_netflow,
  COALESCE(cn.cumulative_adjusted_netflow_system_currency, 0) AS cumulative_adjusted_netflow_system_currency,
  (
    b.market_value - COALESCE(cn.cumulative_adjusted_netflow, 0)
  ) AS total_gain_loss,
  (
    b.market_value - b.total_average_cost
  ) AS unrealized_gain_loss,
  (
    b.market_value - COALESCE(cn.cumulative_adjusted_netflow, 0) - (
      b.market_value - b.total_average_cost
    )
  ) AS realized_gain_loss,
  (
    b.market_value_system_currency - COALESCE(cn.cumulative_adjusted_netflow_system_currency, 0)
  ) AS total_gain_loss_system_currency,
  (
    b.market_value_system_currency - b.total_average_cost_system_currency
  ) AS unrealized_gain_loss_system_currency,
  (
    b.market_value_system_currency - COALESCE(cn.cumulative_adjusted_netflow_system_currency, 0) - (
      b.market_value_system_currency - b.total_average_cost_system_currency
    )
  ) AS realized_gain_loss_system_currency,
  (
    b.fair_value - COALESCE(cn.cumulative_adjusted_netflow, 0)
  ) AS fair_value_total_gain_loss,
  (
    b.fair_value - b.total_average_cost
  ) AS fair_value_unrealized_gain_loss,
  (
    b.fair_value - COALESCE(cn.cumulative_adjusted_netflow, 0) - (
      b.fair_value - b.total_average_cost
    )
  ) AS fair_value_realized_gain_loss,
  (
    b.fair_value_system_currency - COALESCE(cn.cumulative_adjusted_netflow_system_currency, 0)
  ) AS fair_value_total_gain_loss_system_currency,
  (
    b.fair_value_system_currency - b.total_average_cost_system_currency
  ) AS fair_value_unrealized_gain_loss_system_currency,
  (
    b.fair_value_system_currency - COALESCE(cn.cumulative_adjusted_netflow_system_currency, 0) - (
      b.fair_value_system_currency - b.total_average_cost_system_currency
    )
  ) AS fair_value_realized_gain_loss_system_currency
FROM insights.position_by_distribution_mv AS b
ASOF LEFT JOIN insights.flow_by_distribution_mv AS cn
  ON b.account_group_id = cn.account_group_id
  AND b.distribution_type = cn.distribution_type
  AND b.taxonomy_node_id = cn.taxonomy_node_id
  AND b.position_type = cn.position_type
  AND b.currency_code = cn.currency_code
  AND cn.dim_transaction_date <= b.dim_balance_date
WHERE
  b.source_entity_type <> 'user'
Lineage · insights.pnl_by_distribution_mv 11 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.