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=7447.03..7447.04 rows=1 width=8) (actual time=132.407..132.410 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=5283.18..7433.28 rows=5000 width=9) (actual time=0.348..132.359 rows=500.00 loops=1) -> Function Scan on unnest g (cost=0.00..0.10 rows=10 width=4) (actual time=0.038..0.052 rows=100.00 loops=1) -> Hash Join (cost=5283.17..5493.17 rows=500 width=9) (actual time=0.164..1.321 rows=5.00 loops=100) Hash Cond: (k.id = e.lk_id) -> Seq Scan on pc_lk k (cost=0.00..155.00 rows=10000 width=13) (actual time=0.001..0.577 rows=10000.00 loops=100) -> Hash (cost=5276.92..5276.92 rows=500 width=4) (actual time=0.012..0.012 rows=5.00 loops=100) Buckets: 1024 Batches: 1 Memory Usage: 9kB -> Subquery Scan on e (cost=5270.67..5276.92 rows=500 width=4) (actual time=0.009..0.011 rows=5.00 loops=100) -> Limit (cost=5270.67..5271.92 rows=500 width=12) (actual time=0.009..0.010 rows=5.00 loops=100) -> Sort (cost=5270.67..5280.20 rows=3812 width=12) (actual time=0.009..0.009 rows=5.00 loops=100) Sort Key: e_1.ts DESC Sort Method: quicksort Memory: 25kB -> Bitmap Heap Scan on pc_ev e_1 (cost=45.97..5080.73 rows=3812 width=12) (actual time=0.005..0.007 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..45.01 rows=3812 width=0) (actual time=0.003..0.003 rows=5.00 loops=100) Index Cond: (gid = g.id) Index Searches: 100 Planning Time: 0.432 ms Execution Time: 132.450 ms (24 rows)