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

← cluster insights objects holding_values_with_accruals_mv
Overview Objects Graph History
materialized view · insights.holding_values_with_accruals_mv Explain plan ▶
Parallelism
2
Actors
20 / 20
running
Distribution
HASH
Rows
312,262
State size
93.5 MiB
Created
2026-08-18 13:17
Initialized
2026-08-18 13:17
Fragment flags
LOCALITY_PROVIDERMVIEWSNAPSHOT_BACKFILL_STREAM_SCANSTREAM_SCAN
Actors
ActorFragmentWorkerState
739342 58853 51 running
739343 58853 51 running
739344 58854 51 running
739345 58854 51 running
739346 58855 51 running
739347 58855 51 running
739649 58858 51 running
739650 58858 51 running
739653 58856 51 running
739654 58856 51 running
739655 58857 51 running
739656 58857 51 running
+ 8 more actor(s) (20 running)
sql · insights.holding_values_with_accruals_mv — click to expand
CREATE MATERIALIZED VIEW insights.holding_values_with_accruals_mv AS
SELECT
  h.account_id,
  h.asset_id,
  h.dim_value_date,
  h.type,
  h.currency_code,
  h.market_value,
  h.average_cost_per_unit * h.purchased_quantity AS average_cost,
  h.average_cost_per_unit,
  h.purchased_quantity,
  CASE
    WHEN NOT a.account_id IS NULL
    THEN h.market_value + a.accrued_amount
    WHEN NOT h.deposit_profit_accrued IS NULL
    THEN h.market_value + h.deposit_profit_accrued
    ELSE h.market_value
  END AS fair_value,
  CASE
    WHEN NOT a.account_id IS NULL
    THEN a.accrued_amount
    WHEN NOT h.deposit_profit_accrued IS NULL
    THEN h.deposit_profit_accrued
    ELSE CAST(0 AS DECIMAL)
  END AS accrued_value,
  CASE
    WHEN NOT a.account_id IS NULL
    THEN a.accrued_value_system_currency
    WHEN NOT h.deposit_profit_accrued IS NULL
    THEN h.deposit_profit_accrued * COALESCE(fx_sys.rate, CASE WHEN h.currency_code = 'SAR' THEN 1 ELSE NULL END)
    ELSE CAST(0 AS DECIMAL)
  END AS accrued_value_system_currency,
  h.market_value * COALESCE(fx_sys.rate, CASE WHEN h.currency_code = 'SAR' THEN 1 ELSE NULL END) AS market_value_system_currency,
  COALESCE(
    h.total_cost_system_currency,
    (
      h.average_cost_per_unit * h.purchased_quantity
    ) * COALESCE(fx_sys.rate, CASE WHEN h.currency_code = 'SAR' THEN 1 ELSE NULL END)
  ) AS average_cost_system_currency,
  COALESCE(
    h.average_cost_per_unit_system_currency,
    h.average_cost_per_unit * COALESCE(fx_sys.rate, CASE WHEN h.currency_code = 'SAR' THEN 1 ELSE NULL END)
  ) AS average_cost_per_unit_system_currency,
  CASE
    WHEN NOT a.account_id IS NULL
    THEN (
      h.market_value + a.accrued_amount
    ) * COALESCE(fx_sys.rate, CASE WHEN h.currency_code = 'SAR' THEN 1 ELSE NULL END)
    WHEN NOT h.deposit_profit_accrued IS NULL
    THEN (
      h.market_value + h.deposit_profit_accrued
    ) * COALESCE(fx_sys.rate, CASE WHEN h.currency_code = 'SAR' THEN 1 ELSE NULL END)
    ELSE h.market_value * COALESCE(fx_sys.rate, CASE WHEN h.currency_code = 'SAR' THEN 1 ELSE NULL END)
  END AS fair_value_system_currency
FROM insights.holding_values_raw_mv AS h
LEFT JOIN insights.accruals_agg_mv AS a
  ON a.account_id = h.account_id
  AND a.asset_id = h.asset_id
  AND a.dim_value_date = h.dim_value_date
  AND a.type = h.type
  AND a.currency_code = h.currency_code
LEFT JOIN asset_service.foreign_exchange_rates_eod_ft AS fx_sys
  ON fx_sys.source_currency_code = h.currency_code
  AND fx_sys.target_currency_code = 'SAR'
  AND fx_sys.date = h.dim_value_date
WHERE
  NOT fx_sys.rate IS NULL OR h.currency_code = 'SAR'
Lineage · insights.holding_values_with_accruals_mv 5 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.