explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nDXgF

Settings
# exclusive inclusive rows x rows loops node
1. 0.868 763.370 ↓ 10,000.0 10,000 1

Limit (cost=5,415.51..5,415.55 rows=1 width=300) (actual time=758.002..763.37 rows=10,000 loops=1)

  • Buffers: shared hit=752150
2. 4.021 762.502 ↓ 10,000.0 10,000 1

Unique (cost=5,415.51..5,415.55 rows=1 width=300) (actual time=758.001..762.502 rows=10,000 loops=1)

  • Buffers: shared hit=752150
3. 42.642 758.481 ↓ 10,094.0 10,094 1

Sort (cost=5,415.51..5,415.52 rows=1 width=300) (actual time=757.999..758.481 rows=10,094 loops=1)

  • Sort Key: l.linkid, b.docker, l.assetid, l.domainid, i.contractid, cu.customerid, a.assettypeid, l.url, mr.nextcadenceid, (COALESCE(a.matchingthreshold, cu.matchingthreshold)), (trunc((((tu.hourequivalence * (cad.cadence)::numeric) / '2'::numeric) * '3600'::numeric), 0)), (to_char(mr.lastrequest, 'YYYY-MM-DD HH24:MI:SS'::text)), (COALESCE(mdc.queue, mastermdc.queue))
  • Sort Method: quicksort Memory: 11249kB
  • Buffers: shared hit=752150
4. 117.847 715.839 ↓ 37,348.0 37,348 1

Nested Loop (cost=1,008.01..5,415.5 rows=1 width=300) (actual time=5.925..715.839 rows=37,348 loops=1)

  • Buffers: shared hit=752150
5. 60.655 597.992 ↓ 37,348.0 37,348 1

Nested Loop (cost=1,008.01..5,414.11 rows=1 width=197) (actual time=5.897..597.992 rows=37,348 loops=1)

  • Buffers: shared hit=714802
6. 47.674 462.641 ↓ 37,348.0 37,348 1

Nested Loop (cost=1,008.01..5,412.62 rows=1 width=193) (actual time=5.888..462.641 rows=37,348 loops=1)

  • Buffers: shared hit=677454
7. 11.397 377.619 ↓ 37,348.0 37,348 1

Nested Loop (cost=1,007.72..5,412.22 rows=1 width=168) (actual time=5.868..377.619 rows=37,348 loops=1)

  • Buffers: shared hit=565224
8. 98.747 328.874 ↓ 37,348.0 37,348 1

Nested Loop (cost=1,007.72..5,410.97 rows=1 width=176) (actual time=5.861..328.874 rows=37,348 loops=1)

  • Filter: ((cps.domainusageid = 1) OR ((cps.domainusageid = 2) AND (cpsd.domainid IS NOT NULL)) OR ((cps.domainusageid = 3) AND (cpsd.domainid IS NULL)))
  • Buffers: shared hit=527876
9. 0.000 41.917 ↓ 37,642.0 37,642 1

Gather (cost=1,007.72..5,408.43 rows=1 width=188) (actual time=5.84..41.917 rows=37,642 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
  • Buffers: shared hit=490234
10. 16.750 252.349 ↓ 18,821.0 18,821 2 / 2

Nested Loop (cost=7.72..4,408.33 rows=1 width=188) (actual time=3.161..252.349 rows=18,821 loops=2)

  • Buffers: shared hit=490234
11. 17.014 216.778 ↓ 752.8 18,821 2 / 2

Nested Loop (cost=7.57..4,403.88 rows=25 width=169) (actual time=3.143..216.778 rows=18,821 loops=2)

  • Filter: COALESCE(mdc.monitorautomation, mastermdc.monitorautomation)
  • Buffers: shared hit=414949
12. 18.411 199.764 ↓ 380.7 19,034 2 / 2

Nested Loop (cost=7.29..4,384.76 rows=50 width=139) (actual time=3.131..199.764 rows=19,034 loops=2)

  • Buffers: shared hit=414208
13. 16.098 162.319 ↓ 380.7 19,034 2 / 2

Nested Loop (cost=7.01..4,366.14 rows=50 width=107) (actual time=3.111..162.319 rows=19,034 loops=2)

  • Buffers: shared hit=300744
14. 20.401 146.221 ↓ 380.7 19,034 2 / 2

Nested Loop (cost=6.73..4,346.67 rows=50 width=107) (actual time=3.098..146.221 rows=19,034 loops=2)

  • Buffers: shared hit=300003
15. 6.003 106.786 ↓ 333.9 19,034 2 / 2

Hash Join (cost=6.45..4,329.56 rows=57 width=95) (actual time=3.08..106.786 rows=19,034 loops=2)

  • Buffers: shared hit=185795
16. 13.146 100.767 ↓ 121.1 22,896 2 / 2

Nested Loop (cost=5.31..4,327.72 rows=189 width=99) (actual time=2.191..100.767 rows=22,896 loops=2)

  • Buffers: shared hit=185764
17. 5.703 41.771 ↓ 13.7 22,925 2 / 2

Hash Join (cost=4.9..3,393.55 rows=1,668 width=44) (actual time=2.157..41.771 rows=22,925 loops=2)

  • Buffers: shared hit=1969
18. 5.421 36.046 ↓ 8.6 22,925 2 / 2

Hash Join (cost=3.04..3,382.41 rows=2,652 width=36) (actual time=2.121..36.046 rows=22,925 loops=2)

  • Buffers: shared hit=1967
19. 9.901 30.610 ↓ 2.0 22,925 2 / 2

Hash Join (cost=1.74..3,340.93 rows=11,546 width=36) (actual time=2.093..30.61 rows=22,925 loops=2)

  • Buffers: shared hit=1965
20. 20.685 20.685 ↑ 1.2 59,952 2 / 2

Seq Scan on incident i (cost=0..2,961.8 rows=70,599 width=16) (actual time=0.006..20.685 rows=59,952 loops=2)

  • Filter: ((NOT i.deleted) AND (i.incidentstatusid <> ALL ('{4,11,17}'::integer[])))
  • Buffers: shared hit=1963
21. 0.008 0.024 ↑ 1.0 21 2 / 2

Hash (cost=1.43..1.43 rows=21 width=20) (actual time=0.023..0.024 rows=21 loops=2)

  • Buffers: shared hit=2
22. 0.016 0.016 ↑ 1.0 21 2 / 2

Seq Scan on asset a (cost=0..1.43 rows=21 width=20) (actual time=0.007..0.016 rows=21 loops=2)

  • Filter: a.active
  • Buffers: shared hit=2
23. 0.006 0.015 ↑ 1.0 13 2 / 2

Hash (cost=1.13..1.13 rows=13 width=8) (actual time=0.015..0.015 rows=13 loops=2)

  • Buffers: shared hit=2
24. 0.009 0.009 ↑ 1.0 13 2 / 2

Seq Scan on customer cu (cost=0..1.13 rows=13 width=8) (actual time=0.005..0.009 rows=13 loops=2)

  • Buffers: shared hit=2
25. 0.005 0.022 ↓ 1.6 13 2 / 2

Hash (cost=1.76..1.76 rows=8 width=12) (actual time=0.022..0.022 rows=13 loops=2)

  • Buffers: shared hit=2
26. 0.017 0.017 ↓ 1.6 13 2 / 2

Seq Scan on contract_protectionservice cps (cost=0..1.76 rows=8 width=12) (actual time=0.011..0.017 rows=13 loops=2)

  • Filter: ((NOT cps.deleted) AND (cps.protectionserviceid = 2) AND ((cps.domainusageid = 1) OR (cps.domainusageid = 2) OR (cps.domainusageid = 3)))
  • Buffers: shared hit=2
27. 45.850 45.850 ↑ 1.0 1 45,850 / 2

Index Scan using uq_link_linkid_linktypeid on link l (cost=0.42..0.55 rows=1 width=67) (actual time=0.002..0.002 rows=1 loops=45,850)

  • Index Cond: ((l.linkid = i.detectionlinkid) AND (l.linktypeid = 1))
  • Filter: ((NOT l.deleted) AND (l.monitorexecutiontypeid <> 3) AND (i.assetid = l.assetid))
  • Buffers: shared hit=183795
28. 0.004 0.016 ↑ 1.0 3 2 / 2

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

  • Buffers: shared hit=2
29. 0.012 0.012 ↑ 1.0 3 2 / 2

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

  • Filter: es.monitorizable
  • Buffers: shared hit=2
30. 19.035 19.035 ↑ 1.0 1 38,069 / 2

Index Scan using uq_domain_domainid_domaintypeid on domain d (cost=0.28..0.3 rows=1 width=12) (actual time=0.001..0.001 rows=1 loops=38,069)

  • Index Cond: (d.domainid = l.domainid)
  • Filter: d.active
  • Buffers: shared hit=114208
31. 0.000 0.000 ↓ 0.0 0 38,068 / 2

Index Scan using uq_domain_domainid_domaintypeid on domain masterdomain (cost=0.28..0.39 rows=1 width=8) (actual time=0..0 rows=0 loops=38,068)

  • Index Cond: (d.masterdomainid = masterdomain.domainid)
  • Filter: masterdomain.active
  • Buffers: shared hit=741
32. 19.034 19.034 ↑ 1.0 1 38,068 / 2

Index Scan using pk_monitordomainconfiguration on monitordomainconfiguration mdc (cost=0.28..0.37 rows=1 width=40) (actual time=0.001..0.001 rows=1 loops=38,068)

  • Index Cond: (d.monitordomainconfigurationid = mdc.monitordomainconfigurationid)
  • Buffers: shared hit=113464
33. 0.000 0.000 ↓ 0.0 0 38,068 / 2

Index Scan using pk_monitordomainconfiguration on monitordomainconfiguration mastermdc (cost=0.28..0.37 rows=1 width=40) (actual time=0..0 rows=0 loops=38,068)

  • Index Cond: (masterdomain.monitordomainconfigurationid = mastermdc.monitordomainconfigurationid)
  • Buffers: shared hit=741
34. 18.821 18.821 ↑ 1.0 1 37,642 / 2

Index Scan using idx_bot_bottypeid_botid on bot b (cost=0.15..0.18 rows=1 width=43) (actual time=0.001..0.001 rows=1 loops=37,642)

  • Index Cond: ((COALESCE(mdc.monitorbottypeid, mastermdc.monitorbottypeid) = b.bottypeid) AND (COALESCE(mdc.monitorbotid, mastermdc.monitorbotid) = b.botid))
  • Filter: b.active
  • Buffers: shared hit=75285
35. 188.210 188.210 ↑ 1.0 44 37,642

Seq Scan on contract_protectionservice__domain cpsd (cost=0..1.44 rows=44 width=8) (actual time=0.001..0.005 rows=44 loops=37,642)

  • Filter: (NOT cpsd.deleted)
  • Buffers: shared hit=37642
36. 37.348 37.348 ↑ 2.2 5 37,348

Seq Scan on obsolescence o (cost=0..1.11 rows=11 width=4) (actual time=0..0.001 rows=5 loops=37,348)

  • Buffers: shared hit=37348
37. 37.348 37.348 ↑ 1.0 1 37,348

Index Scan using idx_uq_detectionrequest_lastsearch on monitorrequest mr (cost=0.29..0.4 rows=1 width=29) (actual time=0.001..0.001 rows=1 loops=37,348)

  • Index Cond: (l.linkid = mr.linkid)
  • Buffers: shared hit=112230
38. 74.696 74.696 ↑ 1.0 16 37,348

Seq Scan on cadence cad (cost=0..1.21 rows=16 width=20) (actual time=0..0.002 rows=16 loops=37,348)

  • Filter: (cad.cadence > 0)
  • Buffers: shared hit=37348
39. 0.000 0.000 ↑ 5.0 1 37,348

Seq Scan on timeunit tu (cost=0..1.05 rows=5 width=9) (actual time=0..0 rows=1 loops=37,348)

  • Buffers: shared hit=37348
Planning time : 62.089 ms
Execution time : 764.691 ms