add batch remove batch split batch show hidden batches hide batch
db<>fiddle
feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
100000 rows affected
100000 rows affected
QUERY PLAN
Result (cost=0.32..0.33 rows=1 width=8) (actual time=0.062..0.063 rows=1 loops=1)
  InitPlan 1 (returns $0)
    -> Limit (cost=0.29..0.32 rows=1 width=8) (actual time=0.057..0.058 rows=1 loops=1)
          -> Index Only Scan using test1_pkey on test1 (cost=0.29..2854.29 rows=100000 width=8) (actual time=0.052..0.052 rows=1 loops=1)
                Index Cond: (id IS NOT NULL)
                Heap Fetches: 0
Planning Time: 0.484 ms
Execution Time: 0.116 ms
QUERY PLAN
Result (cost=0.32..0.33 rows=1 width=8) (actual time=0.029..0.030 rows=1 loops=1)
  InitPlan 1 (returns $0)
    -> Limit (cost=0.29..0.32 rows=1 width=8) (actual time=0.026..0.027 rows=1 loops=1)
          -> Index Only Scan Backward using test1_pkey on test1 (cost=0.29..2854.29 rows=100000 width=8) (actual time=0.025..0.026 rows=1 loops=1)
                Index Cond: (id IS NOT NULL)
                Heap Fetches: 0
Planning Time: 0.121 ms
Execution Time: 0.048 ms
QUERY PLAN
Finalize Aggregate (cost=29425.24..29425.25 rows=1 width=8) (actual time=547.839..547.903 rows=1 loops=1)
  -> Gather (cost=29425.13..29425.24 rows=1 width=8) (actual time=547.828..547.897 rows=2 loops=1)
        Workers Planned: 1
        Workers Launched: 1
        -> Partial Aggregate (cost=28425.13..28425.14 rows=1 width=8) (actual time=506.744..506.747 rows=1 loops=2)
              -> Hash Join (cost=3280.29..24836.32 rows=1435523 width=8) (actual time=55.291..375.673 rows=1220353 loops=2)
                    Hash Cond: ((t2.joincol)::text = (t1.joincol)::text)
                    -> Parallel Index Only Scan using test2_joincol_idx on test2 t2 (cost=0.29..1472.53 rows=58824 width=4) (actual time=0.035..16.328 rows=50000 loops=2)
                          Heap Fetches: 0
                    -> Hash (cost=1541.00..1541.00 rows=100000 width=12) (actual time=54.471..54.472 rows=100000 loops=2)
                          Buckets: 131072 Batches: 2 Memory Usage: 3250kB
                          -> Seq Scan on test1 t1 (cost=0.00..1541.00 rows=100000 width=12) (actual time=0.041..27.640 rows=100000 loops=2)
Planning Time: 0.766 ms
Execution Time: 548.084 ms
QUERY PLAN
Finalize Aggregate (cost=29425.24..29425.25 rows=1 width=8) (actual time=531.176..531.267 rows=1 loops=1)
  -> Gather (cost=29425.13..29425.24 rows=1 width=8) (actual time=531.164..531.259 rows=2 loops=1)
        Workers Planned: 1
        Workers Launched: 1
        -> Partial Aggregate (cost=28425.13..28425.14 rows=1 width=8) (actual time=498.534..498.536 rows=1 loops=2)
              -> Hash Join (cost=3280.29..24836.32 rows=1435523 width=8) (actual time=50.683..384.156 rows=1220353 loops=2)
                    Hash Cond: ((t2.joincol)::text = (t1.joincol)::text)
                    -> Parallel Index Only Scan using test2_joincol_idx on test2 t2 (cost=0.29..1472.53 rows=58824 width=4) (actual time=0.023..10.405 rows=50000 loops=2)
                          Heap Fetches: 0
                    -> Hash (cost=1541.00..1541.00 rows=100000 width=12) (actual time=50.155..50.156 rows=100000 loops=2)
                          Buckets: 131072 Batches: 2 Memory Usage: 3250kB
                          -> Seq Scan on test1 t1 (cost=0.00..1541.00 rows=100000 width=12) (actual time=0.024..20.525 rows=100000 loops=2)
Planning Time: 0.391 ms
Execution Time: 531.320 ms
QUERY PLAN
Finalize Aggregate (cost=29425.24..29425.25 rows=1 width=8) (actual time=574.136..574.187 rows=1 loops=1)
  -> Gather (cost=29425.13..29425.24 rows=1 width=8) (actual time=574.127..574.181 rows=2 loops=1)
        Workers Planned: 1
        Workers Launched: 1
        -> Partial Aggregate (cost=28425.13..28425.14 rows=1 width=8) (actual time=554.970..554.973 rows=1 loops=2)
              -> Hash Join (cost=3280.29..24836.32 rows=1435523 width=8) (actual time=45.796..405.240 rows=1220353 loops=2)
                    Hash Cond: ((t2.joincol)::text = (t1.joincol)::text)
                    -> Parallel Index Only Scan using test2_joincol_idx on test2 t2 (cost=0.29..1472.53 rows=58824 width=4) (actual time=0.023..5.173 rows=50000 loops=2)
                          Heap Fetches: 0
                    -> Hash (cost=1541.00..1541.00 rows=100000 width=12) (actual time=45.207..45.208 rows=100000 loops=2)
                          Buckets: 131072 Batches: 2 Memory Usage: 3250kB
                          -> Seq Scan on test1 t1 (cost=0.00..1541.00 rows=100000 width=12) (actual time=0.021..9.665 rows=100000 loops=2)
Planning Time: 0.385 ms
Execution Time: 574.235 ms
QUERY PLAN
Finalize Aggregate (cost=29425.24..29425.25 rows=1 width=8) (actual time=527.316..527.371 rows=1 loops=1)
  -> Gather (cost=29425.13..29425.24 rows=1 width=8) (actual time=527.307..527.365 rows=2 loops=1)
        Workers Planned: 1
        Workers Launched: 1
        -> Partial Aggregate (cost=28425.13..28425.14 rows=1 width=8) (actual time=492.690..492.693 rows=1 loops=2)
              -> Hash Join (cost=3280.29..24836.32 rows=1435523 width=8) (actual time=38.583..367.654 rows=1220353 loops=2)
                    Hash Cond: ((t2.joincol)::text = (t1.joincol)::text)
                    -> Parallel Index Only Scan using test2_joincol_idx on test2 t2 (cost=0.29..1472.53 rows=58824 width=4) (actual time=0.022..10.345 rows=50000 loops=2)
                          Heap Fetches: 0
                    -> Hash (cost=1541.00..1541.00 rows=100000 width=12) (actual time=38.010..38.010 rows=100000 loops=2)
                          Buckets: 131072 Batches: 2 Memory Usage: 3250kB
                          -> Seq Scan on test1 t1 (cost=0.00..1541.00 rows=100000 width=12) (actual time=0.019..8.877 rows=100000 loops=2)
Planning Time: 0.388 ms
Execution Time: 527.419 ms
QUERY PLAN
Limit (cost=0.58..0.63 rows=1 width=8) (actual time=0.045..0.045 rows=1 loops=1)
  -> Nested Loop (cost=0.58..98782.29 rows=2440389 width=8) (actual time=0.044..0.044 rows=1 loops=1)
        -> Index Scan Backward using test1_pkey on test1 t1 (cost=0.29..3148.29 rows=100000 width=12) (actual time=0.031..0.031 rows=1 loops=1)
        -> Index Only Scan using test2_joincol_idx on test2 t2 (cost=0.29..0.72 rows=24 width=4) (actual time=0.009..0.009 rows=1 loops=1)
              Index Cond: (joincol = (t1.joincol)::text)
              Heap Fetches: 0
Planning Time: 0.420 ms
Execution Time: 0.065 ms
QUERY PLAN
Limit (cost=0.29..0.32 rows=1 width=8) (actual time=0.007..0.007 rows=1 loops=1)
  -> Index Only Scan Backward using test1_pkey on test1 (cost=0.29..2604.29 rows=100000 width=8) (actual time=0.006..0.006 rows=1 loops=1)
        Heap Fetches: 0
Planning Time: 0.042 ms
Execution Time: 0.016 ms
QUERY PLAN
Limit (cost=33013.94..33014.06 rows=1 width=8) (actual time=639.725..639.781 rows=1 loops=1)
  -> Gather Merge (cost=33013.94..198099.09 rows=1435523 width=8) (actual time=639.724..639.779 rows=1 loops=1)
        Workers Planned: 1
        Workers Launched: 1
        -> Sort (cost=32013.93..35602.74 rows=1435523 width=8) (actual time=615.400..615.403 rows=1 loops=2)
              Sort Key: t1.id DESC NULLS LAST
              Sort Method: top-N heapsort Memory: 25kB
              Worker 0: Sort Method: top-N heapsort Memory: 25kB
              -> Hash Join (cost=3280.29..24836.32 rows=1435523 width=8) (actual time=38.090..344.937 rows=1220353 loops=2)
                    Hash Cond: ((t2.joincol)::text = (t1.joincol)::text)
                    -> Parallel Index Only Scan using test2_joincol_idx on test2 t2 (cost=0.29..1472.53 rows=58824 width=4) (actual time=0.022..15.943 rows=50000 loops=2)
                          Heap Fetches: 0
                    -> Hash (cost=1541.00..1541.00 rows=100000 width=12) (actual time=37.517..37.518 rows=100000 loops=2)
                          Buckets: 131072 Batches: 2 Memory Usage: 3250kB
                          -> Seq Scan on test1 t1 (cost=0.00..1541.00 rows=100000 width=12) (actual time=0.017..8.242 rows=100000 loops=2)
Planning Time: 0.299 ms
Execution Time: 639.817 ms
QUERY PLAN
Limit (cost=2041.00..2041.00 rows=1 width=8) (actual time=19.817..19.819 rows=1 loops=1)
  -> Sort (cost=2041.00..2291.00 rows=100000 width=8) (actual time=19.816..19.817 rows=1 loops=1)
        Sort Key: id DESC NULLS LAST
        Sort Method: top-N heapsort Memory: 25kB
        -> Seq Scan on test1 (cost=0.00..1541.00 rows=100000 width=8) (actual time=0.014..10.460 rows=100000 loops=1)
Planning Time: 0.093 ms
Execution Time: 19.838 ms
QUERY PLAN
Limit (cost=0.58..0.63 rows=1 width=8) (actual time=0.042..0.043 rows=1 loops=1)
  -> Nested Loop (cost=0.58..98782.29 rows=2440389 width=8) (actual time=0.041..0.041 rows=1 loops=1)
        -> Index Scan using test1_id_desc_nulls_last_idx on test1 t1 (cost=0.29..3148.29 rows=100000 width=12) (actual time=0.027..0.027 rows=1 loops=1)
        -> Index Only Scan using test2_joincol_idx on test2 t2 (cost=0.29..0.72 rows=24 width=4) (actual time=0.009..0.009 rows=1 loops=1)
              Index Cond: (joincol = (t1.joincol)::text)
              Heap Fetches: 0
Planning Time: 0.616 ms
Execution Time: 0.066 ms
QUERY PLAN
Limit (cost=0.29..0.32 rows=1 width=8) (actual time=0.013..0.013 rows=1 loops=1)
  -> Index Only Scan using test1_id_desc_nulls_last_idx on test1 (cost=0.29..2604.29 rows=100000 width=8) (actual time=0.012..0.012 rows=1 loops=1)
        Heap Fetches: 0
Planning Time: 0.050 ms
Execution Time: 0.022 ms
QUERY PLAN
Finalize Aggregate (cost=29425.24..29425.25 rows=1 width=8) (actual time=552.401..552.464 rows=1 loops=1)
  -> Gather (cost=29425.13..29425.24 rows=1 width=8) (actual time=552.392..552.458 rows=2 loops=1)
        Workers Planned: 1
        Workers Launched: 1
        -> Partial Aggregate (cost=28425.13..28425.14 rows=1 width=8) (actual time=526.165..526.168 rows=1 loops=2)
              -> Hash Join (cost=3280.29..24836.32 rows=1435523 width=8) (actual time=36.503..406.275 rows=1220353 loops=2)
                    Hash Cond: ((t2.joincol)::text = (t1.joincol)::text)
                    -> Parallel Index Only Scan using test2_joincol_idx on test2 t2 (cost=0.29..1472.53 rows=58824 width=4) (actual time=0.025..4.944 rows=50000 loops=2)
                          Heap Fetches: 0
                    -> Hash (cost=1541.00..1541.00 rows=100000 width=12) (actual time=35.885..35.886 rows=100000 loops=2)
                          Buckets: 131072 Batches: 2 Memory Usage: 3250kB
                          -> Seq Scan on test1 t1 (cost=0.00..1541.00 rows=100000 width=12) (actual time=0.021..13.547 rows=100000 loops=2)
Planning Time: 0.333 ms
Execution Time: 552.510 ms
QUERY PLAN
Finalize Aggregate (cost=29425.24..29425.25 rows=1 width=8) (actual time=527.761..527.820 rows=1 loops=1)
  -> Gather (cost=29425.13..29425.24 rows=1 width=8) (actual time=527.751..527.814 rows=2 loops=1)
        Workers Planned: 1
        Workers Launched: 1
        -> Partial Aggregate (cost=28425.13..28425.14 rows=1 width=8) (actual time=506.119..506.122 rows=1 loops=2)
              -> Hash Join (cost=3280.29..24836.32 rows=1435523 width=8) (actual time=37.965..369.507 rows=1220353 loops=2)
                    Hash Cond: ((t2.joincol)::text = (t1.joincol)::text)
                    -> Parallel Index Only Scan using test2_joincol_idx on test2 t2 (cost=0.29..1472.53 rows=58824 width=4) (actual time=0.025..4.928 rows=50000 loops=2)
                          Heap Fetches: 0
                    -> Hash (cost=1541.00..1541.00 rows=100000 width=12) (actual time=37.365..37.366 rows=100000 loops=2)
                          Buckets: 131072 Batches: 2 Memory Usage: 3250kB
                          -> Seq Scan on test1 t1 (cost=0.00..1541.00 rows=100000 width=12) (actual time=0.021..18.645 rows=100000 loops=2)
Planning Time: 0.429 ms
Execution Time: 527.868 ms
QUERY PLAN
Finalize Aggregate (cost=29425.24..29425.25 rows=1 width=8) (actual time=524.527..524.582 rows=1 loops=1)
  -> Gather (cost=29425.13..29425.24 rows=1 width=8) (actual time=524.518..524.576 rows=2 loops=1)
        Workers Planned: 1
        Workers Launched: 1
        -> Partial Aggregate (cost=28425.13..28425.14 rows=1 width=8) (actual time=506.256..506.258 rows=1 loops=2)
              -> Hash Join (cost=3280.29..24836.32 rows=1435523 width=8) (actual time=43.237..386.511 rows=1220353 loops=2)
                    Hash Cond: ((t2.joincol)::text = (t1.joincol)::text)
                    -> Parallel Index Only Scan using test2_joincol_idx on test2 t2 (cost=0.29..1472.53 rows=58824 width=4) (actual time=0.022..10.380 rows=50000 loops=2)
                          Heap Fetches: 0
                    -> Hash (cost=1541.00..1541.00 rows=100000 width=12) (actual time=42.694..42.695 rows=100000 loops=2)
                          Buckets: 131072 Batches: 2 Memory Usage: 3250kB
                          -> Seq Scan on test1 t1 (cost=0.00..1541.00 rows=100000 width=12) (actual time=0.022..18.825 rows=100000 loops=2)
Planning Time: 0.395 ms
Execution Time: 524.627 ms
QUERY PLAN
Finalize Aggregate (cost=29425.24..29425.25 rows=1 width=8) (actual time=523.798..523.853 rows=1 loops=1)
  -> Gather (cost=29425.13..29425.24 rows=1 width=8) (actual time=523.790..523.848 rows=2 loops=1)
        Workers Planned: 1
        Workers Launched: 1
        -> Partial Aggregate (cost=28425.13..28425.14 rows=1 width=8) (actual time=505.660..505.663 rows=1 loops=2)
              -> Hash Join (cost=3280.29..24836.32 rows=1435523 width=8) (actual time=43.273..352.933 rows=1220353 loops=2)
                    Hash Cond: ((t2.joincol)::text = (t1.joincol)::text)
                    -> Parallel Index Only Scan using test2_joincol_idx on test2 t2 (cost=0.29..1472.53 rows=58824 width=4) (actual time=0.022..4.871 rows=50000 loops=2)
                          Heap Fetches: 0
                    -> Hash (cost=1541.00..1541.00 rows=100000 width=12) (actual time=42.746..42.747 rows=100000 loops=2)
                          Buckets: 131072 Batches: 2 Memory Usage: 3250kB
                          -> Seq Scan on test1 t1 (cost=0.00..1541.00 rows=100000 width=12) (actual time=0.022..7.773 rows=100000 loops=2)
Planning Time: 0.397 ms
Execution Time: 523.900 ms