explain.depesz.com

PostgreSQL's explain analyze made readable

Result: WV4Xa

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 608.187 ↑ 88.8 676 1

Finalize GroupAggregate (cost=361,910.04..370,756.95 rows=60,024 width=66) (actual time=594.297..608.187 rows=676 loops=1)

  • Group Key: sta_2.mg, tow.producent
  • Functions: 69
  • Options: Inlining false, Optimization false, Expressions true, Deforming true
  • Timing: Generation 26.030 ms, Inlining 0.000 ms, Optimization 13.291 ms, Emission 231.854 ms, Total 271.175 ms"Execution Time: 662.641 ms
2. 120.146 649.512 ↑ 52.2 1,135 1

Gather Merge (cost=361,910.04..369,414.25 rows=59,240 width=66) (actual time=594.273..649.512 rows=1,135 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 6.698 529.366 ↑ 78.4 378 3 / 3

Partial GroupAggregate (cost=360,910.02..361,576.47 rows=29,620 width=66) (actual time=521.248..529.366 rows=378 loops=3)

  • Group Key: sta_2.mg, tow.producent
4. 33.323 522.668 ↑ 1.9 15,935 3 / 3

Sort (cost=360,910.02..360,984.07 rows=29,620 width=37) (actual time=521.198..522.668 rows=15,935 loops=3)

  • Sort Key: sta_2.mg, tow.producent
  • Sort Method: quicksort Memory: 2446kB
  • Worker 0: Sort Method: quicksort Memory: 1382kB
  • Worker 1: Sort Method: quicksort Memory: 1444kB
5. 108.978 489.345 ↑ 1.9 15,935 3 / 3

Nested Loop (cost=591.59..358,710.10 rows=29,620 width=37) (actual time=89.453..489.345 rows=15,935 loops=3)

6. 2.549 141.332 ↑ 1.9 15,936 3 / 3

Parallel Append (cost=591.16..231,186.33 rows=29,620 width=13) (actual time=89.291..141.332 rows=15,936 loops=3)

7. 49.797 51.704 ↑ 1.7 6,411 3 / 3

Parallel Bitmap Heap Scan on stany2_z sta_2 (cost=596.60..81,982.47 rows=11,148 width=13) (actual time=29.711..51.704 rows=6,411 loops=3)

  • Recheck Cond: (((mg)::text = ANY ('{SC,PU,ZU}'::text[])) AND (ilosc > '0'::numeric))
  • Heap Blocks: exact=1267
8. 1.907 1.907 ↑ 1.4 19,232 1 / 3

Bitmap Index Scan on stany2_z_mg_towar_n_idx (cost=0.00..589.91 rows=26,755 width=0) (actual time=5.721..5.721 rows=19,232 loops=1)

  • Index Cond: ((mg)::text = ANY ('{SC,PU,ZU}'::text[]))
9. 49.014 50.710 ↑ 1.6 6,680 2 / 3

Parallel Bitmap Heap Scan on stany2_p sta (cost=591.16..84,978.48 rows=10,855 width=13) (actual time=47.582..76.065 rows=6,680 loops=2)

  • Recheck Cond: (((mg)::text = ANY ('{SC,PU,ZU}'::text[])) AND (ilosc > '0'::numeric))
  • Heap Blocks: exact=1908
10. 1.696 1.696 ↑ 1.9 13,361 1 / 3

Bitmap Index Scan on stany2_p_mg_towar_n_idx (cost=0.00..584.65 rows=26,053 width=0) (actual time=5.087..5.088 rows=13,361 loops=1)

  • Index Cond: ((mg)::text = ANY ('{SC,PU,ZU}'::text[]))
11. 35.331 36.369 ↓ 2.0 15,214 1 / 3

Parallel Bitmap Heap Scan on stany2_s sta_1 (cost=422.92..64,077.28 rows=7,617 width=13) (actual time=83.776..109.107 rows=15,214 loops=1)

  • Recheck Cond: (((mg)::text = ANY ('{SC,PU,ZU}'::text[])) AND (ilosc > '0'::numeric))
  • Heap Blocks: exact=5331
12. 1.038 1.038 ↑ 1.2 15,214 1 / 3

Bitmap Index Scan on stany2_s_mg_towar_n_idx (cost=0.00..418.35 rows=18,280 width=0) (actual time=3.115..3.115 rows=15,214 loops=1)

  • Index Cond: ((mg)::text = ANY ('{SC,PU,ZU}'::text[]))
13. 239.035 239.035 ↑ 1.0 1 47,807 / 3

Index Scan using towar_idx1 on towar tow (cost=0.43..4.30 rows=1 width=38) (actual time=0.015..0.015 rows=1 loops=47,807)

  • Index Cond: ((numer)::text = (sta_2.towar_n)::text)