Changes between Version 3 and Version 4 of AdvancedReports


Ignore:
Timestamp:
08/29/26 01:26:13 (2 weeks ago)
Author:
231020
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AdvancedReports

    v3 v4  
    317317        pending_stats AS (
    318318            SELECT
    319                 s.id                      AS pst_stock_id,
    320                 COUNT(tr.id)               AS pst_pending_count
     319                tr.stock_id AS pst_stock_id,
     320                COUNT(tr.id) AS pst_pending_count
    321321            FROM trade_request tr
    322             JOIN stock s ON tr.stock_symbol = s.symbol
    323322            WHERE tr.status = 'PENDING'
    324             GROUP BY s.id
     323            GROUP BY tr.stock_id
    325324        )
    326325
     
    417416--                     ws_active_watchers ← COUNT(DISTINCT w.user_id) (watchlist w)
    418417
    419 -- pending_stats = γ s.id;
    420 --                   pst_stock_id ← s.id,
     418-- pending_stats = γ tr.stock_id;
     419--                   pst_stock_id ← tr.stock_id,
    421420--                   pst_pending_count ← COUNT(tr.id) (
    422 --                 σ status = 'PENDING' (trade_request tr) ⋈ trade_stock_symbol = symbol stock s )
     421--                 σ status = 'PENDING' (trade_request tr) )
    423422
    424423π stock_id ← s.id, symbol ← s.symbol, stock_name ← s.name, current_price ← s.current_price,