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

← cluster adib_rm objects client_top_allocations_by_sector_mv
Overview Objects Graph History
materialized view · adib_rm.client_top_allocations_by_sector_mv Explain plan ▶
Parallelism
2
Actors
10 / 10
running
Distribution
HASH
Rows
3,690
State size
1.3 MiB
Created
2026-08-25 16:57
Initialized
2026-08-25 16:56
Fragment flags
MVIEWSNAPSHOT_BACKFILL_STREAM_SCANSTREAM_SCAN
Actors
ActorFragmentWorkerState
115875 24582 26 running
115876 24582 26 running
115877 24584 26 running
115878 24584 26 running
115879 24583 26 running
115880 24583 26 running
115881 24585 26 running
115882 24585 26 running
115883 24586 26 running
115884 24586 26 running
sql · adib_rm.client_top_allocations_by_sector_mv — click to expand
CREATE MATERIALIZED VIEW adib_rm.client_top_allocations_by_sector_mv AS
SELECT
  cag.client_id,
  cag.type AS account_group_type,
  JSONB_AGG(
    JSONB_BUILD_OBJECT(
      'sector',
      ps.sector,
      'taxonomyNodeId',
      ps.taxonomy_node_id,
      'marketValue',
      JSONB_BUILD_OBJECT('amount', CAST(ps.market_value AS VARCHAR), 'currencyCode', ps.currency_code),
      'fairValue',
      JSONB_BUILD_OBJECT('amount', CAST(ps.fair_value AS VARCHAR), 'currencyCode', ps.currency_code),
      'weight',
      ps.weight,
      'rank',
      ps.rank
    ) ORDER BY ps.rank
  ) AS top_allocations_sector
FROM insights.client_to_account_groups_mv AS cag
JOIN (
  SELECT
    account_group_id,
    sector,
    taxonomy_node_id,
    market_value,
    fair_value,
    currency_code,
    weight,
    rank
  FROM (
    SELECT
      account_group_id,
      sector,
      taxonomy_node_id,
      market_value,
      fair_value,
      currency_code,
      weight,
      ROW_NUMBER() OVER (PARTITION BY account_group_id ORDER BY market_value DESC, sector ASC) AS rank
    FROM (
      SELECT
        i.account_group_id,
        i.taxonomy_node_id AS sector,
        i.taxonomy_node_id,
        i.market_value,
        i.fair_value,
        i.currency_code,
        i.weight
      FROM insights.intraday_position_by_distribution_mv AS i
      WHERE
        i.distribution_type = 'sectors' AND i.position_type = 'POSITION'
    ) AS latest
  ) AS ranked
  WHERE
    ranked.rank <= 5
) AS ps
  ON ps.account_group_id = cag.account_group_id
GROUP BY
  cag.client_id,
  cag.type
Lineage · adib_rm.client_top_allocations_by_sector_mv 4 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.