explain.depesz.com

PostgreSQL's explain analyze made readable

Result: uXZg

Settings
# exclusive inclusive rows x rows loops node
1. 2.968 229.348 ↑ 1.3 89 1

Subquery Scan on x (cost=245.26..46,865.29 rows=112 width=263) (actual time=10.977..229.348 rows=89 loops=1)

2. 38.670 226.380 ↑ 1.3 89 1

Hash Left Join (cost=245.26..46,863.33 rows=112 width=263) (actual time=10.870..226.380 rows=89 loops=1)

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

Index Scan using "input - typ_szablonu+status" on input ai (cost=0.28..283.04 rows=112 width=1,115) (actual time=0.052..0.481 rows=89 loops=1)

  • Index Cond: ((typ_szablonu = 2) AND (status = ANY ('{9,-10}'::integer[])))
4. 1.282 2.732 ↓ 1.1 2,447 1

Hash (cost=217.77..217.77 rows=2,177 width=231) (actual time=2.731..2.732 rows=2,447 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 688kB
5. 1.450 1.450 ↓ 1.1 2,447 1

Seq Scan on koszyk k (cost=0.00..217.77 rows=2,177 width=231) (actual time=0.012..1.450 rows=2,447 loops=1)

6.          

SubPlan (forHash Left Join)

7. 6.141 184.497 ↑ 1.0 1 89

Aggregate (cost=413.59..413.60 rows=1 width=32) (actual time=2.073..2.073 rows=1 loops=89)

8. 0.408 178.356 ↑ 50.0 2 89

Nested Loop Left Join (cost=15.39..412.09 rows=100 width=47) (actual time=1.423..2.004 rows=2 loops=89)

9. 28.657 175.330 ↑ 50.0 2 89

Nested Loop Left Join (cost=15.11..354.09 rows=100 width=44) (actual time=1.407..1.970 rows=2 loops=89)

  • Join Filter: ((_int.indeks_katalogowy(kp.id_wms_asortyment))::text = apoz.kodproduktu)
  • Rows Removed by Join Filter: 8
10. 46.547 144.803 ↑ 50.0 2 89

Hash Right Join (cost=14.83..244.48 rows=100 width=36) (actual time=1.317..1.627 rows=2 loops=89)

  • Hash Cond: ((k_1.nazwa)::text = ('AGORA_SKLEP-'::text || apoz.idpaczki))
11. 42.275 42.275 ↓ 1.1 2,447 89

Seq Scan on koszyk k_1 (cost=0.00..217.77 rows=2,177 width=25) (actual time=0.003..0.475 rows=2,447 loops=89)

12. 0.356 55.981 ↑ 50.0 2 89

Hash (cost=13.58..13.58 rows=100 width=64) (actual time=0.629..0.629 rows=2 loops=89)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
13. 0.178 55.625 ↑ 50.0 2 89

Subquery Scan on apoz (cost=0.29..13.58 rows=100 width=64) (actual time=0.382..0.625 rows=2 loops=89)

14. 31.684 55.447 ↑ 50.0 2 89

Result (cost=0.29..12.58 rows=100 width=64) (actual time=0.381..0.623 rows=2 loops=89)

15. 22.250 23.763 ↑ 50.0 2 89

ProjectSet (cost=0.29..8.83 rows=100 width=1,114) (actual time=0.264..0.267 rows=2 loops=89)

16. 1.513 1.513 ↑ 1.0 1 89

Index Scan using "input - id_paczki" on input ai2 (cost=0.29..8.31 rows=1 width=1,082) (actual time=0.016..0.017 rows=1 loops=89)

  • Index Cond: (((((plik_importu -> 'Wysylka'::text) -> 'Paczka'::text) -> 0) ->> 'idpaczki'::text) = ((((ai.plik_importu -> 'Wysylka'::text) -> 'Paczka'::text) -> 0) ->> 'idpaczki'::text))
17. 1.870 1.870 ↓ 2.5 5 187

Index Scan using "idx - id_koszyk + id_wms_asortyment" on koszyk_pozycje kp (cost=0.28..0.57 rows=2 width=20) (actual time=0.006..0.010 rows=5 loops=187)

  • Index Cond: (id_koszyk = k_1.id)
18. 2.618 2.618 ↑ 1.0 1 187

Index Scan using "pk - powiazania_dokumentow" on powiazania_dokumentow pd (cost=0.29..0.57 rows=1 width=15) (actual time=0.013..0.014 rows=1 loops=187)

  • Index Cond: (kp.id_wfmag = id_pozycji_zamowienia)
  • Filter: ((nr_wz)::text ~~* 'WAD%'::text)
  • Rows Removed by Filter: 1