explain.depesz.com

PostgreSQL's explain analyze made readable

Result: XEUR

Settings
# exclusive inclusive rows x rows loops node
1. 0.023 0.287 ↑ 1.0 1 1

Sort (cost=62.58..62.59 rows=1 width=227) (actual time=0.287..0.287 rows=1 loops=1)

  • Sort Key: p.tel_idklienta, mg.tmg_idmagazynu, p.tr_idtrans, (sortkonta(numerkonta(p.tel_lpprefix, (p.tel_sortorder)::text), 5)), (random())
  • Sort Method: quicksort Memory: 25kB
2. 0.146 0.264 ↑ 1.0 1 1

Nested Loop Left Join (cost=9.86..62.57 rows=1 width=227) (actual time=0.261..0.264 rows=1 loops=1)

  • Join Filter: (tg_udzielonerabaty.tel_idelem = p.tel_idelem)
3. 0.002 0.115 ↑ 1.0 1 1

Nested Loop (cost=9.86..36.86 rows=1 width=166) (actual time=0.112..0.115 rows=1 loops=1)

4. 0.002 0.105 ↑ 1.0 1 1

Nested Loop (cost=9.72..36.70 rows=1 width=166) (actual time=0.103..0.105 rows=1 loops=1)

5. 0.002 0.092 ↑ 1.0 1 1

Nested Loop (cost=9.30..28.26 rows=1 width=162) (actual time=0.090..0.092 rows=1 loops=1)

6. 0.003 0.073 ↑ 1.0 1 1

Nested Loop Left Join (cost=8.88..19.83 rows=1 width=143) (actual time=0.071..0.073 rows=1 loops=1)

  • Join Filter: (stat_hist.sh_idref = p.tel_idelem)
  • Filter: (COALESCE((statusy.st_flaga & 8), 0) = 0)
7. 0.027 0.027 ↑ 1.0 1 1

Index Scan using tg_transelem_pkey on tg_transelem p (cost=0.43..8.45 rows=1 width=143) (actual time=0.025..0.027 rows=1 loops=1)

  • Index Cond: (tel_idelem = 3290577)
  • Filter: ((tel_flaga & 4224) = 0)
8. 0.028 0.043 ↓ 0.0 0 1

Hash Right Join (cost=8.45..11.36 rows=1 width=8) (actual time=0.043..0.043 rows=0 loops=1)

  • Hash Cond: (statusy.st_idstatusu = stat_hist.st_idstatusu)
9. 0.000 0.000 ↓ 0.0 0

Seq Scan on ts_statusy statusy (cost=0.00..2.65 rows=65 width=8) (never executed)

10. 0.000 0.015 ↓ 0.0 0 1

Hash (cost=8.44..8.44 rows=1 width=8) (actual time=0.015..0.015 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
11. 0.015 0.015 ↓ 0.0 0 1

Index Scan using tg_statusyhistora_tid on tg_statusyhistoria stat_hist (cost=0.42..8.44 rows=1 width=8) (actual time=0.015..0.015 rows=0 loops=1)

  • Index Cond: ((sh_type = 17) AND (sh_idref = 3290577) AND (sh_aktualny = true))
  • Filter: sh_aktualny
12. 0.017 0.017 ↑ 1.0 1 1

Index Scan using tg_towary_pkey on tg_towary towar (cost=0.42..8.44 rows=1 width=23) (actual time=0.017..0.017 rows=1 loops=1)

  • Index Cond: (ttw_idtowaru = p.ttw_idtowaru)
  • Filter: (NOT istmptowar(ttw_flaga))
13. 0.011 0.011 ↑ 1.0 1 1

Index Scan using tg_towmag_pkey on tg_towmag (cost=0.42..8.44 rows=1 width=8) (actual time=0.011..0.011 rows=1 loops=1)

  • Index Cond: (ttm_idtowmag = p.ttm_idtowmag)
14. 0.008 0.008 ↑ 1.0 1 1

Index Scan using tg_magazyny_pkey on tg_magazyny mg (cost=0.14..0.16 rows=1 width=4) (actual time=0.008..0.008 rows=1 loops=1)

  • Index Cond: (tmg_idmagazynu = tg_towmag.tmg_idmagazynu)
  • Filter: (fm_idcentrali = 1)
15. 0.003 0.003 ↓ 0.0 0 1

Seq Scan on tg_udzielonerabaty (cost=0.00..20.12 rows=405 width=4) (actual time=0.003..0.003 rows=0 loops=1)

  • Filter: (tel_idelem = 3290577)
Planning time : 3.304 ms
Execution time : 0.605 ms