explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ZLpg

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Merge Join (cost=312,479.32..4,544,980.19 rows=275,584,152 width=5,321) (actual rows= loops=)

  • Merge Cond: (bkm.obg = pb.obg)
2.          

CTE partnerbank

3. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=401.81..950.58 rows=2,401 width=2,121) (actual rows= loops=)

  • Hash Cond: (pb_1.marktgebiet_id = mg.id)
4. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=395.91..911.67 rows=2,401 width=53) (actual rows= loops=)

  • Hash Cond: (vp_1.id = pb_1.vertragspartner_id)
5. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=308.58..806.14 rows=2,401 width=45) (actual rows= loops=)

  • Hash Cond: (vertriebskanal_zuordnung.vertragspartner_id = vp_1.id)
6. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on vertriebskanal_zuordnung (cost=85.49..550.04 rows=2,401 width=8) (actual rows= loops=)

  • Recheck Cond: (vertriebsstelle_id IS NULL)
  • Filter: ((vertriebskanal = 0) AND (gueltig_ab <= ('now'::cstring)::date) AND ((gueltig_bis IS NULL) OR (gueltig_bis >= ('now'::cstring)::date)))
7. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on vertriebskanal_zuordnung_vertriebsstelle_id_idx (cost=0.00..84.89 rows=4,347 width=0) (actual rows= loops=)

  • Index Cond: (vertriebsstelle_id IS NULL)
8. 0.000 0.000 ↓ 0.0

Hash (cost=153.04..153.04 rows=5,604 width=41) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Seq Scan on vertragspartner vp_1 (cost=0.00..153.04 rows=5,604 width=41) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Hash (cost=60.48..60.48 rows=2,148 width=12) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Seq Scan on partnerbank pb_1 (cost=0.00..60.48 rows=2,148 width=12) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Hash (cost=5.38..5.38 rows=41 width=2,072) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=3.70..5.38 rows=41 width=2,072) (actual rows= loops=)

  • Hash Cond: (mg.region_id = r.id)
14. 0.000 0.000 ↓ 0.0

Seq Scan on marktgebiete mg (cost=0.00..1.41 rows=41 width=524) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Hash (cost=3.55..3.55 rows=12 width=1,552) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=2.31..3.55 rows=12 width=1,552) (actual rows= loops=)

  • Hash Cond: (r.organisationseinheit_id = oe.id)
17. 0.000 0.000 ↓ 0.0

Seq Scan on region r (cost=0.00..1.12 rows=12 width=524) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Hash (cost=2.23..2.23 rows=7 width=1,036) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=1.09..2.23 rows=7 width=1,036) (actual rows= loops=)

  • Hash Cond: (oe.geschaeftsgebiet_id = gg.id)
20. 0.000 0.000 ↓ 0.0

Seq Scan on organisationseinheit oe (cost=0.00..1.07 rows=7 width=8) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Hash (cost=1.04..1.04 rows=4 width=1,036) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Seq Scan on geschaeftsgebiet gg (cost=0.00..1.04 rows=4 width=1,036) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Merge Join (cost=130,962.09..217,324.11 rows=4,902,108 width=1,388) (actual rows= loops=)

  • Merge Cond: (((ba.obg / 100)) = bkm.obg)
24. 0.000 0.000 ↓ 0.0

Sort (cost=7,180.06..7,289.31 rows=43,698 width=109) (actual rows= loops=)

  • Sort Key: ((ba.obg / 100))
25. 0.000 0.000 ↓ 0.0

Seq Scan on bkm_anmeldung ba (cost=0.00..1,270.98 rows=43,698 width=109) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Materialize (cost=123,782.02..124,277.30 rows=99,056 width=1,279) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

Sort (cost=123,782.02..124,029.66 rows=99,056 width=1,279) (actual rows= loops=)

  • Sort Key: bkm.obg
28. 0.000 0.000 ↓ 0.0

Hash Join (cost=7.39..5,186.38 rows=99,056 width=1,279) (actual rows= loops=)

  • Hash Cond: (bkm.zielgruppe_id = zg.id)
29. 0.000 0.000 ↓ 0.0

Seq Scan on bestandskundenmailing_werbeerfolgskontrolle bkm (cost=0.00..3,816.86 rows=99,086 width=184) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

Hash (cost=5.94..5.94 rows=116 width=1,095) (actual rows= loops=)

31. 0.000 0.000 ↓ 0.0

Hash Join (cost=1.18..5.94 rows=116 width=1,095) (actual rows= loops=)

  • Hash Cond: (zg.zielgruppe_mailingplanung = zm.id)
32. 0.000 0.000 ↓ 0.0

Seq Scan on bkm_zielgruppe zg (cost=0.00..3.16 rows=116 width=59) (actual rows= loops=)

33. 0.000 0.000 ↓ 0.0

Hash (cost=1.08..1.08 rows=8 width=1,036) (actual rows= loops=)

34. 0.000 0.000 ↓ 0.0

Seq Scan on zielgruppe_mailingplanung zm (cost=0.00..1.08 rows=8 width=1,036) (actual rows= loops=)

35. 0.000 0.000 ↓ 0.0

Materialize (cost=180,566.66..180,814.86 rows=49,640 width=3,933) (actual rows= loops=)

36. 0.000 0.000 ↓ 0.0

Sort (cost=180,566.66..180,690.76 rows=49,640 width=3,933) (actual rows= loops=)

  • Sort Key: pb.obg
37. 0.000 0.000 ↓ 0.0

Hash Join (cost=2,595.39..8,722.93 rows=49,640 width=3,933) (actual rows= loops=)

  • Hash Cond: ((mp.partnerkennung)::text = (vp.partnerkennung)::text)
38. 0.000 0.000 ↓ 0.0

Seq Scan on mailingplanungsdaten mp (cost=0.00..2,235.65 rows=115,865 width=40) (actual rows= loops=)

39. 0.000 0.000 ↓ 0.0

Hash (cost=1,416.37..1,416.37 rows=2,401 width=3,893) (actual rows= loops=)

40. 0.000 0.000 ↓ 0.0

Nested Loop (cost=135.31..1,416.37 rows=2,401 width=3,893) (actual rows= loops=)

41. 0.000 0.000 ↓ 0.0

Hash Join (cost=135.03..216.06 rows=2,401 width=2,738) (actual rows= loops=)

  • Hash Cond: (pb.bilanzsumme_id = pbs.id)
42. 0.000 0.000 ↓ 0.0

CTE Scan on partnerbank pb (cost=0.00..48.02 rows=2,401 width=2,718) (actual rows= loops=)

43. 0.000 0.000 ↓ 0.0

Hash (cost=76.68..76.68 rows=4,668 width=20) (actual rows= loops=)

44. 0.000 0.000 ↓ 0.0

Seq Scan on partnerbank_bilanzsumme pbs (cost=0.00..76.68 rows=4,668 width=20) (actual rows= loops=)

45. 0.000 0.000 ↓ 0.0

Index Scan using vertragspartner_pkey on vertragspartner vp (cost=0.28..0.49 rows=1 width=1,155) (actual rows= loops=)

  • Index Cond: (id = pb.vp_id)