explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Ix4b

Settings
# exclusive inclusive rows x rows loops node
1. 6.305 24,020.169 ↑ 481,666.0 1 1

Merge Left Join (cost=20,000,102,783.43..20,002,314,579.85 rows=481,666 width=340) (actual time=7,043.302..24,020.169 rows=1 loops=1)

  • Merge Cond: (((ba_partite.ptkeypar)::text = (ba_partite1.ptkeypar)::text) AND (ba_partite.ptkeynum = ba_partite1.ptkeynum))
2. 0.006 17,344.474 ↑ 341,243.0 1 1

Nested Loop (cost=20,000,000,024.71..20,002,198,893.18 rows=341,243 width=340) (actual time=367.610..17,344.474 rows=1 loops=1)

  • Join Filter: ((ba_prinot.pncodbun)::text = (ba_tmpsalbun.bucodbun)::text)
3. 0.003 17,344.462 ↑ 60,396.0 1 1

Nested Loop (cost=10,000,000,024.71..10,001,175,156.85 rows=60,396 width=340) (actual time=367.604..17,344.462 rows=1 loops=1)

  • Join Filter: ((ba_prinot_m.pncoduff)::text = (ba_tmpuniope.uocoduop)::text)
4. 0.008 17,344.452 ↑ 10,690.0 1 1

Nested Loop (cost=24.71..993,937.23 rows=10,690 width=351) (actual time=367.596..17,344.452 rows=1 loops=1)

  • Join Filter: ((ba_partite.ptserial)::text = (ba_prinot_m.pnserial)::text)
5. 0.034 17,344.416 ↑ 10,690.0 1 1

Nested Loop (cost=24.71..988,530.27 rows=10,690 width=342) (actual time=367.566..17,344.416 rows=1 loops=1)

  • Join Filter: ((ba_caupar.cccodcau)::text = (ba_prinot.pncaupar)::text)
  • Rows Removed by Join Filter: 26
6. 0.015 17,344.031 ↑ 18,409.5 27 1

Nested Loop (cost=24.71..441,659.94 rows=497,057 width=348) (actual time=367.470..17,344.031 rows=27 loops=1)

7. 729.515 17,343.956 ↑ 497,057.0 1 1

Nested Loop Left Join (cost=24.71..435,434.00 rows=497,057 width=310) (actual time=367.441..17,343.956 rows=1 loops=1)

  • Filter: (hashed SubPlan 1)
  • Rows Removed by Filter: 992752
8. 1,723.055 1,723.055 ↑ 1.0 992,753 1

Index Scan using ba_partite0025 on ba_partite002 ba_partite (cost=0.00..128,899.32 rows=994,114 width=310) (actual time=0.011..1,723.055 rows=992,753 loops=1)

  • Filter: (((pttipsot)::text = 'CLI'::text) AND ((ptcodval)::text = 'EUR'::text) AND (ptflrite = 0) AND (ptsplpay = 0))
  • Rows Removed by Filter: 65079
9. 14,891.295 14,891.295 ↑ 1.0 1 992,753

Index Scan using pk_ba_keysog002 on ba_keysog002 ba_keysog (cost=0.00..0.30 rows=1 width=27) (actual time=0.014..0.015 rows=1 loops=992,753)

  • Index Cond: (((kstipsog)::text = (ba_partite.pttipsot)::text) AND ((kstipsog)::text = 'CLI'::text) AND ((kscodsog)::text = (ba_partite.ptcodsot)::text))
10.          

SubPlan (forNested Loop Left Join)

11. 0.002 0.091 ↑ 1.0 1 1

HashAggregate (cost=24.70..24.71 rows=1 width=7) (actual time=0.091..0.091 rows=1 loops=1)

12. 0.008 0.089 ↑ 1.0 1 1

Nested Loop (cost=8.55..24.70 rows=1 width=7) (actual time=0.088..0.089 rows=1 loops=1)

13. 0.013 0.064 ↑ 1.0 1 1

Bitmap Heap Scan on ba_keysog002 ba_keysog (cost=8.55..16.40 rows=1 width=23) (actual time=0.063..0.064 rows=1 loops=1)

  • Recheck Cond: ((((kstipsog)::text = 'CLI'::text) AND ((kscodsog)::text = '458110'::text)) OR ((kscodcom)::text = '458110'::text))
  • Filter: (((kstipsog)::text = 'CLI'::text) AND ((((kscodsog)::text = '458110'::text) AND (0 <> ALL ('{3,4}'::integer[]))) OR (((kscodcom)::text = '458110'::text) AND (0 = ANY ('{3,4}'::integer[])))))
14. 0.000 0.051 ↓ 0.0 0 1

BitmapOr (cost=8.55..8.55 rows=2 width=0) (actual time=0.051..0.051 rows=0 loops=1)

15. 0.043 0.043 ↑ 1.0 1 1

Bitmap Index Scan on pk_ba_keysog002 (cost=0.00..4.27 rows=1 width=0) (actual time=0.043..0.043 rows=1 loops=1)

  • Index Cond: (((kstipsog)::text = 'CLI'::text) AND ((kscodsog)::text = '458110'::text))
16. 0.008 0.008 ↓ 0.0 0 1

Bitmap Index Scan on ba_keysog0023 (cost=0.00..4.27 rows=1 width=0) (actual time=0.008..0.008 rows=0 loops=1)

  • Index Cond: ((kscodcom)::text = '458110'::text)
17. 0.017 0.017 ↑ 1.0 1 1

Index Only Scan using pk_ba_contact on ba_contact (cost=0.00..8.28 rows=1 width=16) (actual time=0.017..0.017 rows=1 loops=1)

  • Index Cond: (cocompanyid = (ba_keysog.kscodcom)::text)
  • Heap Fetches: 1
18. 0.022 0.060 ↓ 27.0 27 1

Materialize (cost=0.00..12.73 rows=1 width=38) (actual time=0.027..0.060 rows=27 loops=1)

19. 0.038 0.038 ↓ 27.0 27 1

Index Scan using pk_ba_caupar on ba_caupar (cost=0.00..12.72 rows=1 width=38) (actual time=0.011..0.038 rows=27 loops=1)

  • Filter: (ccsalval = 0)
20. 0.351 0.351 ↑ 1.0 1 27

Index Scan using pk_ba_prinot002 on ba_prinot002 ba_prinot (cost=0.00..1.09 rows=1 width=36) (actual time=0.013..0.013 rows=1 loops=27)

  • Index Cond: (((pnserial)::text = (ba_partite.ptserial)::text) AND (cprownum = ba_partite.ptnumrow))
21. 0.028 0.028 ↑ 1.0 1 1

Index Scan using pk_ba_prinot_m002 on ba_prinot_m002 ba_prinot_m (cost=0.00..0.49 rows=1 width=34) (actual time=0.023..0.028 rows=1 loops=1)

  • Index Cond: ((pnserial)::text = (ba_prinot.pnserial)::text)
22. 0.003 0.007 ↑ 1,130.0 1 1

Materialize (cost=10,000,000,000.00..10,000,000,026.95 rows=1,130 width=38) (actual time=0.006..0.007 rows=1 loops=1)

23. 0.004 0.004 ↑ 1,130.0 1 1

Seq Scan on cptmp_oclkybsoow ba_tmpuniope (cost=10,000,000,000.00..10,000,000,021.30 rows=1,130 width=38) (actual time=0.004..0.004 rows=1 loops=1)

24. 0.001 0.006 ↑ 1,130.0 1 1

Materialize (cost=10,000,000,000.00..10,000,000,026.95 rows=1,130 width=38) (actual time=0.002..0.006 rows=1 loops=1)

25. 0.005 0.005 ↑ 1,130.0 1 1

Seq Scan on cptmp_nmaizxsawz ba_tmpsalbun (cost=10,000,000,000.00..10,000,000,021.30 rows=1,130 width=38) (actual time=0.002..0.005 rows=1 loops=1)

26. 6,359.358 6,669.390 ↑ 34.6 15,399 1

Sort (cost=102,758.72..104,090.97 rows=532,900 width=20) (actual time=6,667.095..6,669.390 rows=15,399 loops=1)

  • Sort Key: ba_partite1.ptkeypar, ba_partite1.ptkeynum
  • Sort Method: external sort Disk: 17800kB
27. 261.803 310.032 ↓ 1.0 535,183 1

Bitmap Heap Scan on ba_partite002 ba_partite1 (cost=10,221.98..52,070.59 rows=532,900 width=20) (actual time=53.602..310.032 rows=535,183 loops=1)

  • Recheck Cond: ((ptaggpar = 1) OR (ptaggpar = 3))
28. 0.002 48.229 ↓ 0.0 0 1

BitmapOr (cost=10,221.98..10,221.98 rows=538,507 width=0) (actual time=48.229..48.229 rows=0 loops=1)

29. 47.197 47.197 ↑ 1.0 524,297 1

Bitmap Index Scan on ba_partite0028 (cost=0.00..9,746.81 rows=527,259 width=0) (actual time=47.197..47.197 rows=524,297 loops=1)

  • Index Cond: (ptaggpar = 1)
30. 1.030 1.030 ↑ 1.0 10,886 1

Bitmap Index Scan on ba_partite0028 (cost=0.00..208.73 rows=11,248 width=0) (actual time=1.030..1.030 rows=10,886 loops=1)

  • Index Cond: (ptaggpar = 3)