Sort (cost=473756301482.78..477226107732.78 rows=1387922500000 width=16) (actual time=0.093..0.095 rows=30 loops=1) |
Output: (CASE WHEN (g2.i = 1) THEN gn.i ELSE ((p.n + 1) - gn.i) END), gm.i, g2.i, gn.i |
Sort Key: gm.i, g2.i, gn.i |
Sort Method: quicksort Memory: 26kB |
Buffers: shared hit=16 |
-> Nested Loop (cost=15.43..27803995845.52 rows=1387922500000 width=16) (actual time=0.056..0.078 rows=30 loops=1) |
Output: CASE WHEN (g2.i = 1) THEN gn.i ELSE ((p.n + 1) - gn.i) END, gm.i, g2.i, gn.i |
Buffers: shared hit=16 |
-> Nested Loop (cost=0.56..45545807.90 rows=1632850000 width=12) (actual time=0.047..0.058 rows=15 loops=1) |
Output: p.n, gn.i, gm.i |
Buffers: shared hit=13 |
-> Nested Loop (cost=0.28..53552.90 rows=1921000 width=12) (actual time=0.039..0.041 rows=3 loops=1) |
Output: p.n, p.m, gn.i |
Buffers: shared hit=4 |
-> Seq Scan on public.parameters p (cost=0.00..32.60 rows=2260 width=8) (actual time=0.011..0.011 rows=1 loops=1) |
Output: p.n, p.m |
Buffers: shared hit=1 |
-> Index Only Scan using numbers_pkey on public.numbers gn (cost=0.28..15.18 rows=850 width=4) (actual time=0.023..0.024 rows=3 loops=1) |
Output: gn.i |
Index Cond: (gn.i <= p.n) |
Heap Fetches: 3 |
Buffers: shared hit=3 |
-> Index Only Scan using numbers_pkey on public.numbers gm (cost=0.28..15.18 rows=850 width=4) (actual time=0.003..0.004 rows=5 loops=3) |
Output: gm.i |
Index Cond: (gm.i <= p.m) |
Heap Fetches: 15 |
Buffers: shared hit=9 |
-> Materialize (cost=14.87..39.74 rows=850 width=4) (actual time=0.001..0.001 rows=2 loops=15) |
Output: g2.i |
Buffers: shared hit=3 |
-> Bitmap Heap Scan on public.numbers g2 (cost=14.87..35.49 rows=850 width=4) (actual time=0.006..0.006 rows=2 loops=1) |
Output: g2.i |
Recheck Cond: (g2.i <= 2) |
Heap Blocks: exact=1 |
Buffers: shared hit=3 |
-> Bitmap Index Scan on numbers_pkey (cost=0.00..14.65 rows=850 width=0) (actual time=0.003..0.003 rows=2 loops=1) |
Index Cond: (g2.i <= 2) |
Buffers: shared hit=2 |
Planning Time: 0.204 ms |
Execution Time: 0.145 ms |