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

← cluster insights objects position_snapshot_mv
Overview Objects Graph History
materialized view · insights.position_snapshot_mv Explain plan ▶
Parallelism
2
Actors
20 / 20
running
Distribution
HASH
Rows
1,150
State size
293.3 KiB
Created
2026-08-20 17:22
Initialized
2026-08-20 17:22
Fragment flags
LOCALITY_PROVIDERMVIEWSNAPSHOT_BACKFILL_STREAM_SCANSTREAM_SCAN
Actors
ActorFragmentWorkerState
746073 63458 51 running
746074 63458 51 running
746075 63461 51 running
746076 63461 51 running
746183 63452 51 running
746184 63452 51 running
746185 63454 51 running
746186 63454 51 running
746187 63453 51 running
746188 63453 51 running
746247 63455 51 running
746248 63455 51 running
+ 8 more actor(s) (20 running)
sql · insights.position_snapshot_mv — click to expand
CREATE MATERIALIZED VIEW insights.position_snapshot_mv AS
WITH converted AS (
  SELECT
    atag.account_group_id,
    atag.base_currency,
    h.type AS position_type,
    h.dim_value_date,
    h.market_value * COALESCE(fx.rate, CASE WHEN h.currency_code = atag.base_currency THEN 1 ELSE NULL END) AS market_value,
    h.fair_value * COALESCE(fx.rate, CASE WHEN h.currency_code = atag.base_currency THEN 1 ELSE NULL END) AS fair_value,
    h.accrued_value * COALESCE(fx.rate, CASE WHEN h.currency_code = atag.base_currency THEN 1 ELSE NULL END) AS accrued_value,
    ABS(h.market_value) * COALESCE(fx.rate, CASE WHEN h.currency_code = atag.base_currency THEN 1 ELSE NULL END) AS relationship_value,
    ABS(h.fair_value) * COALESCE(fx.rate, CASE WHEN h.currency_code = atag.base_currency THEN 1 ELSE NULL END) AS fair_relationship_value,
    h.market_value_system_currency,
    h.fair_value_system_currency,
    h.accrued_value_system_currency,
    ABS(h.market_value_system_currency) AS relationship_value_system_currency,
    ABS(h.fair_value_system_currency) AS fair_relationship_value_system_currency
  FROM insights.holding_values_latest_mv AS h
  JOIN insights.account_to_account_groups_mv AS atag
    ON atag.account_id = h.account_id
    AND atag.effective_end_date IS NULL
    AND atag.source_entity_type <> 'user'
  LEFT JOIN insights.fx_rates_snapshot_mv AS fx
    ON fx.source_currency_code = h.currency_code
    AND fx.target_currency_code = atag.base_currency
  WHERE
    NOT fx.rate IS NULL OR h.currency_code = atag.base_currency
)
SELECT
  account_group_id,
  MAX(dim_value_date) AS dim_balance_date,
  COALESCE(position_type, 'POSITION') AS position_type,
  base_currency AS currency_code,
  SUM(market_value) AS market_value,
  SUM(fair_value) AS fair_value,
  SUM(accrued_value) AS accrued_value,
  SUM(market_value_system_currency) AS market_value_system_currency,
  SUM(fair_value_system_currency) AS fair_value_system_currency,
  SUM(accrued_value_system_currency) AS accrued_value_system_currency,
  SUM(relationship_value) AS relationship_value,
  SUM(fair_relationship_value) AS fair_relationship_value,
  SUM(relationship_value_system_currency) AS relationship_value_system_currency,
  SUM(fair_relationship_value_system_currency) AS fair_relationship_value_system_currency
FROM converted
GROUP BY
  GROUPING SETS (
    (account_group_id, base_currency, position_type),
    (account_group_id, base_currency)
  )
Lineage · insights.position_snapshot_mv 9 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.