explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PBVl : Optimization for: plan #QsUI

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.000 11,886.780 ↑ 88.8 676 1

Finalize GroupAggregate (cost=361,883.37..370,730.29 rows=60,024 width=66) (actual time=11,875.842..11,886.780 rows=676 loops=1)

  • Group Key: sta_2.mg, tow.producent
  • Functions: 69
  • Options: Inlining false, Optimization false, Expressions true, Deforming true
  • Timing: Generation 23.914 ms, Inlining 0.000 ms, Optimization 15.571 ms, Emission 234.835 ms, Total 274.320 ms"Execution Time: 11963.155 ms
2. 188.544 11,952.831 ↑ 58.7 1,009 1

Gather Merge (cost=361,883.37..369,387.59 rows=59,240 width=66) (actual time=11,875.815..11,952.831 rows=1,009 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 6.491 11,764.287 ↑ 88.2 336 3 / 3

Partial GroupAggregate (cost=360,883.35..361,549.80 rows=29,620 width=66) (actual time=11,756.351..11,764.287 rows=336 loops=3)

  • Group Key: sta_2.mg, tow.producent
4. 39.503 11,757.796 ↑ 1.9 15,935 3 / 3

Sort (cost=360,883.35..360,957.40 rows=29,620 width=37) (actual time=11,756.277..11,757.796 rows=15,935 loops=3)

  • Sort Key: sta_2.mg, tow.producent
  • Sort Method: quicksort Memory: 2106kB
  • Worker 0: Sort Method: quicksort Memory: 1134kB
  • Worker 1: Sort Method: quicksort Memory: 2416kB
5. 133.835 11,718.293 ↑ 1.9 15,935 3 / 3

Nested Loop (cost=591.59..358,683.43 rows=29,620 width=37) (actual time=129.163..11,718.293 rows=15,935 loops=3)

6. 4.447 10,867.353 ↑ 1.9 15,936 3 / 3

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

7. 2,684.854 2,708.374 ↓ 1.7 19,232 1 / 3

Parallel Bitmap Heap Scan on stany2_z sta_2 (cost=596.60..81,982.47 rows=11,148 width=13) (actual time=157.116..8,125.122 rows=19,232 loops=1)

  • Recheck Cond: (((mg)::text = ANY ('{SC,PU,ZU}'::text[])) AND (ilosc > '0'::numeric))
8. 23.520 23.520 ↑ 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=70.560..70.560 rows=19,232 loops=1)

  • Index Cond: ((mg)::text = ANY ('{SC,PU,ZU}'::text[]))
9. 4,707.026 4,720.352 ↑ 2.4 4,454 3 / 3

Parallel Bitmap Heap Scan on stany2_p sta (cost=591.16..84,978.48 rows=10,855 width=13) (actual time=48.044..4,720.352 rows=4,454 loops=3)

  • Recheck Cond: (((mg)::text = ANY ('{SC,PU,ZU}'::text[])) AND (ilosc > '0'::numeric))
  • Heap Blocks: exact=1233
10. 13.326 13.326 ↑ 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=39.979..39.979 rows=13,361 loops=1)

  • Index Cond: ((mg)::text = ANY ('{SC,PU,ZU}'::text[]))
11. 3,432.980 3,434.180 ↑ 1.0 7,607 2 / 3

Parallel Bitmap Heap Scan on stany2_s sta_1 (cost=422.92..64,077.28 rows=7,617 width=13) (actual time=61.952..5,151.270 rows=7,607 loops=2)

  • Recheck Cond: (((mg)::text = ANY ('{SC,PU,ZU}'::text[])) AND (ilosc > '0'::numeric))
  • Heap Blocks: exact=5158
12. 1.200 1.200 ↑ 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.600..3.600 rows=15,214 loops=1)

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

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

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