explain.depesz.com

PostgreSQL's explain analyze made readable

Result: g28q

Settings
# exclusive inclusive rows x rows loops node
1. 120.234 67,194.206 ↓ 10,000.0 10,000 1

Limit (cost=832,454.22..1,760,962.13 rows=1 width=207) (actual time=23,128.823..67,194.206 rows=10,000 loops=1)

  • Buffers: shared hit=4320974
2. 64.771 67,073.972 ↓ 10,000.0 10,000 1

Merge Join (cost=832,454.22..1,760,962.13 rows=1 width=207) (actual time=23,128.821..67,073.972 rows=10,000 loops=1)

  • Buffers: shared hit=4320974
3. 4.169 67,003.398 ↓ 2,500.0 10,000 1

Nested Loop (cost=832,452.54..2,070,461.43 rows=4 width=181) (actual time=23,128.763..67,003.398 rows=10,000 loops=1)

  • Buffers: shared hit=4320973
4. 0.009 0.009 ↑ 5.0 1 1

Index Scan using pk_timeunit on timeunit tu (cost=0.13..12.21 rows=5 width=9) (actual time=0.009..0.009 rows=1 loops=1)

  • Buffers: shared hit=2
5. 13.411 66,999.220 ↓ 10,000.0 10,000 1

Materialize (cost=832,452.41..2,070,449.16 rows=1 width=172) (actual time=23,128.751..66,999.22 rows=10,000 loops=1)

  • Buffers: shared hit=4320971
6. 14,306.099 66,985.809 ↓ 10,000.0 10,000 1

Nested Loop (cost=832,452.41..2,070,449.16 rows=1 width=172) (actual time=23,128.746..66,985.809 rows=10,000 loops=1)

  • Filter: ((cps.domainusageid = 1) OR ((cps.domainusageid = 2) AND (cpsd.contractprotectionservicedomainid IS NOT NULL)) OR ((cps.domainusageid = 3) AND (cpsd.contractprotectionservicedomainid IS NULL)))
  • Buffers: shared hit=4320971
7. 25.882 25,039.710 ↓ 10,000.0 10,000 1

Nested Loop (cost=832,452.41..2,069,221.04 rows=1 width=184) (actual time=23,124.257..25,039.71 rows=10,000 loops=1)

  • Buffers: shared hit=1430971
8. 4,631.234 24,973.828 ↓ 10,000.0 10,000 1

Nested Loop (cost=832,451.97..2,069,220.46 rows=1 width=159) (actual time=23,124.218..24,973.828 rows=10,000 loops=1)

  • Buffers: shared hit=1390917
9. 0.034 0.034 ↑ 309.5 2 1

Index Scan using pk_contractprotectionservice on contract_protectionservice cps (cost=0.28..129.56 rows=619 width=12) (actual time=0.028..0.034 rows=2 loops=1)

  • Filter: ((NOT cps.deleted) AND (cps.protectionserviceid = 2) AND ((cps.domainusageid = 1) OR (cps.domainusageid = 2) OR (cps.domainusageid = 3)))
  • Buffers: shared hit=3
10. 5,884.791 20,342.560 ↓ 8,117,067.0 16,234,134 2

Materialize (cost=832,451.69..2,069,072.34 rows=2 width=151) (actual time=3,496.305..10,171.28 rows=16,234,134 loops=2)

  • Buffers: shared hit=1390914
11. 0.000 14,457.769 ↓ 11,119,844.5 22,239,689 1

Gather (cost=832,451.69..2,069,072.33 rows=2 width=151) (actual time=6,992.608..14,457.769 rows=22,239,689 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
  • Buffers: shared hit=1390914
12. 4,867.078 16,356.022 ↓ 7,413,230.0 7,413,230 3 / 3

Hash Join (cost=831,451.69..2,068,072.13 rows=1 width=151) (actual time=6,986.5..16,356.022 rows=7,413,230 loops=3)

  • Buffers: shared hit=1390914
13. 4,509.696 4,509.696 ↑ 1.3 14,401,595 3 / 3

Seq Scan on incident i (cost=0..1,033,626.52 rows=18,043,899 width=16) (actual time=0.013..4,509.696 rows=14,401,595 loops=3)

  • Filter: ((NOT i.deleted) AND (i.incidentstatusid <> ALL ('{4,11,17}'::integer[])))
  • Buffers: shared hit=757728
14. 1,308.497 6,979.248 ↓ 1.3 1,912,013 3 / 3

Hash (cost=806,222.01..806,222.01 rows=1,441,696 width=159) (actual time=6,979.248..6,979.248 rows=1,912,013 loops=3)

  • Buffers: shared hit=633086
15. 474.682 5,670.751 ↓ 1.3 1,912,013 3 / 3

Hash Join (cost=3,054.42..806,222.01 rows=1,441,696 width=159) (actual time=38.683..5,670.751 rows=1,912,013 loops=3)

  • Buffers: shared hit=633086
16. 497.310 5,196.050 ↓ 1.3 1,912,013 3 / 3

Hash Join (cost=3,053.12..801,202.5 rows=1,441,696 width=159) (actual time=38.645..5,196.05 rows=1,912,013 loops=3)

  • Buffers: shared hit=633083
17. 541.144 4,698.575 ↓ 1.3 1,930,930 3 / 3

Hash Join (cost=3,039.5..793,610.05 rows=1,441,696 width=130) (actual time=38.464..4,698.575 rows=1,930,930 loops=3)

  • Buffers: shared hit=633068
18. 458.157 4,138.167 ↓ 1.3 1,930,930 3 / 3

Hash Join (cost=1,709.73..788,495.42 rows=1,441,696 width=107) (actual time=18.921..4,138.167 rows=1,930,930 loops=3)

  • Buffers: shared hit=631394
19. 520.394 3,679.615 ↓ 1.3 1,930,930 3 / 3

Hash Join (cost=1,674.36..784,654.82 rows=1,441,696 width=99) (actual time=18.507..3,679.615 rows=1,930,930 loops=3)

  • Buffers: shared hit=631340
20. 583.739 3,143.284 ↓ 1.4 2,366,375 3 / 3

Hash Join (cost=170.85..778,829.24 rows=1,646,315 width=91) (actual time=2.393..3,143.284 rows=2,366,375 loops=3)

  • Buffers: shared hit=629138
21. 630.053 2,557.235 ↓ 1.2 2,577,149 3 / 3

Hash Join (cost=1.15..773,200.88 rows=2,077,423 width=75) (actual time=0.039..2,557.235 rows=2,577,149 loops=3)

  • Buffers: shared hit=628883
22. 1,927.164 1,927.164 ↑ 1.2 4,235,655 3 / 3

Seq Scan on link l (cost=0..753,788.8 rows=5,193,558 width=79) (actual time=0.007..1,927.164 rows=4,235,655 loops=3)

  • Filter: ((NOT l.deleted) AND (l.monitorexecutiontypeid <> 3) AND (l.linktypeid = 1))
  • Buffers: shared hit=628880
23. 0.007 0.018 ↑ 1.0 4 3 / 3

Hash (cost=1.1..1.1 rows=4 width=4) (actual time=0.018..0.018 rows=4 loops=3)

  • Buffers: shared hit=3
24. 0.011 0.011 ↑ 1.0 4 3 / 3

Seq Scan on enforcementstatus es (cost=0..1.1 rows=4 width=4) (actual time=0.009..0.011 rows=4 loops=3)

  • Filter: es.monitorizable
  • Buffers: shared hit=3
25. 0.809 2.310 ↑ 1.0 3,372 3 / 3

Hash (cost=127.55..127.55 rows=3,372 width=16) (actual time=2.31..2.31 rows=3,372 loops=3)

  • Buffers: shared hit=255
26. 1.501 1.501 ↑ 1.0 3,372 3 / 3

Seq Scan on asset a (cost=0..127.55 rows=3,372 width=16) (actual time=0.008..1.501 rows=3,372 loops=3)

  • Filter: a.active
  • Buffers: shared hit=255
27. 5.247 15.937 ↓ 1.0 32,186 3 / 3

Hash (cost=1,101.37..1,101.37 rows=32,171 width=8) (actual time=15.936..15.937 rows=32,186 loops=3)

  • Buffers: shared hit=2202
28. 10.690 10.690 ↓ 1.0 32,186 3 / 3

Seq Scan on domain d (cost=0..1,101.37 rows=32,171 width=8) (actual time=0.009..10.69 rows=32,186 loops=3)

  • Filter: (d.active AND (d.masterdomainid IS NULL))
  • Buffers: shared hit=2202
29. 0.155 0.395 ↑ 1.0 772 3 / 3

Hash (cost=25.72..25.72 rows=772 width=8) (actual time=0.395..0.395 rows=772 loops=3)

  • Buffers: shared hit=54
30. 0.240 0.240 ↑ 1.0 772 3 / 3

Seq Scan on customer cu (cost=0..25.72 rows=772 width=8) (actual time=0.009..0.24 rows=772 loops=3)

  • Buffers: shared hit=54
31. 8.674 19.264 ↑ 1.0 34,301 3 / 3

Hash (cost=901.01..901.01 rows=34,301 width=31) (actual time=19.263..19.264 rows=34,301 loops=3)

  • Buffers: shared hit=1674
32. 10.590 10.590 ↑ 1.0 34,301 3 / 3

Seq Scan on monitordomainconfiguration mdc (cost=0..901.01 rows=34,301 width=31) (actual time=0.007..10.59 rows=34,301 loops=3)

  • Buffers: shared hit=1674
33. 0.094 0.165 ↑ 1.0 345 3 / 3

Hash (cost=8.45..8.45 rows=345 width=45) (actual time=0.165..0.165 rows=345 loops=3)

  • Buffers: shared hit=15
34. 0.071 0.071 ↑ 1.0 345 3 / 3

Seq Scan on bot b (cost=0..8.45 rows=345 width=45) (actual time=0.011..0.071 rows=345 loops=3)

  • Buffers: shared hit=15
35. 0.008 0.019 ↑ 1.0 13 3 / 3

Hash (cost=1.13..1.13 rows=13 width=4) (actual time=0.019..0.019 rows=13 loops=3)

  • Buffers: shared hit=3
36. 0.011 0.011 ↑ 1.0 13 3 / 3

Seq Scan on obsolescence o (cost=0..1.13 rows=13 width=4) (actual time=0.009..0.011 rows=13 loops=3)

  • Buffers: shared hit=3
37. 40.000 40.000 ↑ 1.0 1 10,000

Index Scan using idx_monitorrequest_link on monitorrequest mr (cost=0.44..0.57 rows=1 width=29) (actual time=0.004..0.004 rows=1 loops=10,000)

  • Index Cond: (l.linkid = mr.linkid)
  • Buffers: shared hit=40054
38. 27,640.000 27,640.000 ↑ 1.0 25,421 10,000

Seq Scan on contract_protectionservice__domain cpsd (cost=0..592.42 rows=25,428 width=12) (actual time=0.001..2.764 rows=25,421 loops=10,000)

  • Filter: (NOT cpsd.deleted)
  • Buffers: shared hit=2890000
39. 5.797 5.803 ↓ 4,499.8 89,995 1

Sort (cost=1.68..1.73 rows=20 width=20) (actual time=0.024..5.803 rows=89,995 loops=1)

  • Sort Key: cad.timeunitid
  • Sort Method: quicksort Memory: 26kB
  • Buffers: shared hit=1
40. 0.006 0.006 ↑ 1.0 20 1

Seq Scan on cadence cad (cost=0..1.25 rows=20 width=20) (actual time=0.004..0.006 rows=20 loops=1)

  • Filter: (cad.cadence > 0)
  • Buffers: shared hit=1
Planning time : 31.112 ms
Execution time : 68,160.788 ms