add remove split language chart show hidden hide
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
version
PostgreSQL 13.4 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.4.1 20200928 (Red Hat 8.4.1-1), 64-bit
1 rows affected
n m
3 5
i
1
2
3
3
2
1
1
2
3
3
2
1
1
2
3
3
2
1
1
2
3
3
2
1
1
2
3
3
2
1
QUERY PLAN
Nested Loop (cost=75.20..25222.53 rows=2000000 width=4) (actual time=0.033..0.058 rows=30 loops=1)
  Output: g.i
  Buffers: shared hit=2
  InitPlan 1 (returns $0)
    -> Seq Scan on public.param (cost=0.00..32.60 rows=2260 width=4) (actual time=0.007..0.008 rows=1 loops=1)
          Output: param.m
          Buffers: shared hit=1
  -> Function Scan on pg_catalog.generate_series gm (cost=0.00..10.00 rows=1000 width=0) (actual time=0.018..0.018 rows=5 loops=1)
        Output: gm.j
        Function Call: generate_series(1, $0)
        Buffers: shared hit=1
  -> Materialize (cost=42.60..184.93 rows=2000 width=4) (actual time=0.003..0.007 rows=6 loops=5)
        Output: g.i
        Buffers: shared hit=1
        -> Append (cost=42.60..154.93 rows=2000 width=4) (actual time=0.014..0.030 rows=6 loops=1)
              Buffers: shared hit=1
              CTE g
                -> Function Scan on pg_catalog.generate_series (cost=32.60..42.60 rows=1000 width=4) (actual time=0.012..0.013 rows=3 loops=1)
                      Output: generate_series.generate_series
                      Function Call: generate_series(1, $1)
                      Buffers: shared hit=1
                      InitPlan 2 (returns $1)
                        -> Seq Scan on public.param param_1 (cost=0.00..32.60 rows=2260 width=4) (actual time=0.005..0.005 rows=1 loops=1)
                              Output: param_1.n
                              Buffers: shared hit=1
              -> CTE Scan on g (cost=0.00..20.00 rows=1000 width=4) (actual time=0.013..0.014 rows=3 loops=1)
                    Output: g.i
                    Buffers: shared hit=1
              -> Sort (cost=69.83..72.33 rows=1000 width=4) (actual time=0.014..0.014 rows=3 loops=1)
                    Output: g_1.i
                    Sort Key: g_1.i DESC
                    Sort Method: quicksort Memory: 25kB
                    -> CTE Scan on g g_1 (cost=0.00..20.00 rows=1000 width=4) (actual time=0.001..0.004 rows=3 loops=1)
                          Output: g_1.i
Planning Time: 0.144 ms
Execution Time: 0.089 ms