psql:repro_plain.sql:4: NOTICE: table "pc_ev" does not exist, skipping psql:repro_plain.sql:4: NOTICE: table "pc_lk" does not exist, skipping QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Aggregate (cost=53215.44..53215.45 rows=1 width=8) (actual time=2.187..2.189 rows=1.00 loops=1) InitPlan 1 -> Function Scan on generate_series g_1 (cost=0.00..1.25 rows=100 width=4) (actual time=0.012..0.021 rows=100.00 loops=1) -> Nested Loop (cost=5247.50..53201.74 rows=4978 width=9) (actual time=0.104..2.150 rows=500.00 loops=1) -> Nested Loop (cost=5247.20..52584.61 rows=5000 width=4) (actual time=0.095..1.017 rows=500.00 loops=1) -> Function Scan on unnest g (cost=0.00..0.10 rows=10 width=4) (actual time=0.037..0.045 rows=100.00 loops=1) -> Limit (cost=5247.20..5248.45 rows=500 width=12) (actual time=0.008..0.009 rows=5.00 loops=100) -> Sort (cost=5247.20..5256.60 rows=3758 width=12) (actual time=0.008..0.008 rows=5.00 loops=100) Sort Key: e.ts DESC Sort Method: quicksort Memory: 25kB -> Bitmap Heap Scan on pc_ev e (cost=45.55..5059.94 rows=3758 width=12) (actual time=0.004..0.006 rows=5.00 loops=100) Recheck Cond: (gid = g.id) Filter: ((ts <= '2026-03-31 00:00:00+00'::timestamp with time zone) AND (ts >= ('2026-03-31 00:00:00+00'::timestamp with time zone - '90 days'::interval))) Heap Blocks: exact=372 -> Bitmap Index Scan on pc_ev_gid_idx (cost=0.00..44.61 rows=3758 width=0) (actual time=0.002..0.002 rows=5.00 loops=100) Index Cond: (gid = g.id) Index Searches: 100 -> Memoize (cost=0.30..0.99 rows=1 width=13) (actual time=0.002..0.002 rows=1.00 loops=500) Cache Key: e.lk_id Cache Mode: logical Hits: 0 Misses: 500 Evictions: 0 Overflows: 0 Memory Usage: 57kB -> Index Scan using pc_lk_pkey on pc_lk k (cost=0.29..0.98 rows=1 width=13) (actual time=0.002..0.002 rows=1.00 loops=500) Index Cond: (id = e.lk_id) Index Searches: 500 Planning Time: 0.386 ms Execution Time: 2.224 ms (26 rows)