explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2iMm

Settings
# exclusive inclusive rows x rows loops node
1. 6.427 47,715.433 ↑ 1.4 90 1

Subquery Scan on x (cost=251.27..345,744.31 rows=128 width=262) (actual time=946.818..47,715.433 rows=90 loops=1)

2. 42.534 47,709.006 ↑ 1.4 90 1

Hash Left Join (cost=251.27..345,742.07 rows=128 width=262) (actual time=946.704..47,709.006 rows=90 loops=1)

  • Hash Cond: (('AGORA_SKLEP-'::text || ((((ai.plik_importu -> 'Wysylka'::text) -> 'Paczka'::text) -> 0) ->> 'idpaczki'::text)) = (k.nazwa)::text)
3. 0.702 0.702 ↑ 1.4 90 1

Index Scan using "input - typ_szablonu+status" on input ai (cost=0.28..321.00 rows=128 width=1,114) (actual time=0.090..0.702 rows=90 loops=1)

  • Index Cond: ((typ_szablonu = 2) AND (status = ANY ('{9,-10}'::integer[])))
4. 2.018 3.930 ↓ 1.0 2,446 1

Hash (cost=220.44..220.44 rows=2,444 width=230) (actual time=3.930..3.930 rows=2,446 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 687kB
5. 1.912 1.912 ↓ 1.0 2,446 1

Seq Scan on koszyk k (cost=0.00..220.44 rows=2,444 width=230) (actual time=0.012..1.912 rows=2,446 loops=1)

6.          

SubPlan (forHash Left Join)

7. 9.540 47,661.840 ↑ 1.0 1 90

Aggregate (cost=2,696.51..2,696.53 rows=1 width=32) (actual time=529.576..529.576 rows=1 loops=90)

8. 60.750 47,652.300 ↑ 753.0 2 90

Hash Right Join (cost=2,226.77..2,673.92 rows=1,506 width=47) (actual time=527.679..529.470 rows=2 loops=90)

  • Hash Cond: (pd.id_pozycji_zamowienia = kp.id_wfmag)
9. 1,738.980 1,738.980 ↓ 1.0 3,958 90

Seq Scan on powiazania_dokumentow pd (cost=0.00..428.40 rows=3,951 width=15) (actual time=0.027..19.322 rows=3,958 loops=90)

  • Filter: ((nr_wz)::text ~~* 'WAD%'::text)
  • Rows Removed by Filter: 11994
10. 1.080 45,852.570 ↑ 753.0 2 90

Hash (cost=2,207.94..2,207.94 rows=1,506 width=44) (actual time=509.473..509.473 rows=2 loops=90)

  • Buckets: 2048 Batches: 1 Memory Usage: 17kB
11. 120.330 45,851.490 ↑ 753.0 2 90

Hash Right Join (cost=1,181.43..2,207.94 rows=1,506 width=44) (actual time=508.506..509.461 rows=2 loops=90)

  • Hash Cond: (kp.id_koszyk = k_1.id)
  • Join Filter: ((_int.indeks_katalogowy(kp.id_wms_asortyment))::text = (((json_array_elements((((((ai2.plik_importu -> 'Wysylka'::text) -> 'Paczka'::text) -> 0) -> 'PozycjePaczki'::text) -> 'PozycjaPaczki'::text))) ->> 'kodproduktu'::text)))
  • Rows Removed by Join Filter: 8
12. 75.870 75.870 ↓ 1.0 5,374 90

Seq Scan on koszyk_pozycje kp (cost=0.00..154.68 rows=5,268 width=20) (actual time=0.005..0.843 rows=5,374 loops=90)

13. 0.540 45,655.290 ↑ 753.0 2 90

Hash (cost=1,162.61..1,162.61 rows=1,506 width=36) (actual time=507.281..507.281 rows=2 loops=90)

  • Buckets: 2048 Batches: 1 Memory Usage: 17kB
14. 1.126 45,654.750 ↑ 753.0 2 90

Hash Left Join (cost=250.99..1,162.61 rows=1,506 width=36) (actual time=312.839..507.275 rows=2 loops=90)

  • Hash Cond: (('AGORA_SKLEP-'::text || (((((ai2.plik_importu -> 'Wysylka'::text) -> 'Paczka'::text) -> 0) ->> 'idpaczki'::text))) = (k_1.nazwa)::text)
15. 32.400 45,651.690 ↑ 750.0 2 90

Result (cost=0.00..840.31 rows=1,500 width=64) (actual time=312.809..507.241 rows=2 loops=90)

16. 13.590 45,619.290 ↑ 750.0 2 90

ProjectSet (cost=0.00..784.06 rows=1,500 width=1,113) (actual time=312.684..506.881 rows=2 loops=90)

17. 45,605.700 45,605.700 ↑ 15.0 1 90

Seq Scan on input ai2 (cost=0.00..776.26 rows=15 width=1,081) (actual time=312.535..506.730 rows=1 loops=90)

  • Filter: (((((plik_importu -> 'Wysylka'::text) -> 'Paczka'::text) -> 0) ->> 'idpaczki'::text) = ((((ai.plik_importu -> 'Wysylka'::text) -> 'Paczka'::text) -> 0) ->> 'idpaczki'::text))
  • Rows Removed by Filter: 2434
18. 0.907 1.934 ↓ 1.0 2,446 1

Hash (cost=220.44..220.44 rows=2,444 width=25) (actual time=1.934..1.934 rows=2,446 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 176kB
19. 1.027 1.027 ↓ 1.0 2,446 1

Seq Scan on koszyk k_1 (cost=0.00..220.44 rows=2,444 width=25) (actual time=0.016..1.027 rows=2,446 loops=1)