explain.depesz.com

PostgreSQL's explain analyze made readable

Result: brLpu

Settings
# exclusive inclusive rows x rows loops node
1. 0.879 785.420 ↓ 10,000.0 10,000 1

Limit (cost=5,415.4..5,415.44 rows=1 width=300) (actual time=780.017..785.42 rows=10,000 loops=1)

  • Buffers: shared hit=752150
2. 4.018 784.541 ↓ 10,000.0 10,000 1

Unique (cost=5,415.4..5,415.44 rows=1 width=300) (actual time=780.016..784.541 rows=10,000 loops=1)

  • Buffers: shared hit=752150
3. 42.394 780.523 ↓ 10,094.0 10,094 1

Sort (cost=5,415.4..5,415.41 rows=1 width=300) (actual time=780.009..780.523 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. 120.808 738.129 ↓ 37,348.0 37,348 1

Nested Loop (cost=1,008.01..5,415.39 rows=1 width=300) (actual time=4.312..738.129 rows=37,348 loops=1)

  • Buffers: shared hit=752150
5. 67.398 617.321 ↓ 37,348.0 37,348 1

Nested Loop (cost=1,008.01..5,414 rows=1 width=197) (actual time=4.287..617.321 rows=37,348 loops=1)

  • Buffers: shared hit=714802
6. 50.327 475.227 ↓ 37,348.0 37,348 1

Nested Loop (cost=1,008.01..5,412.51 rows=1 width=193) (actual time=4.28..475.227 rows=37,348 loops=1)

  • Buffers: shared hit=677454
7. 13.728 387.552 ↓ 37,348.0 37,348 1

Nested Loop (cost=1,007.72..5,412.11 rows=1 width=168) (actual time=4.262..387.552 rows=37,348 loops=1)

  • Buffers: shared hit=565224
8. 109.910 336.476 ↓ 37,348.0 37,348 1

Nested Loop (cost=1,007.72..5,410.86 rows=1 width=176) (actual time=4.257..336.476 rows=37,348 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=527876
9. 0.000 38.356 ↓ 37,642.0 37,642 1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  • Buffers: shared hit=1965
20. 23.577 23.577 ↑ 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..23.577 rows=59,952 loops=2)

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

Hash (cost=1.43..1.43 rows=21 width=20) (actual time=0.022..0.023 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.006..0.016 rows=21 loops=2)

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

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

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

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

  • Buffers: shared hit=2
25. 0.004 0.020 ↓ 1.6 13 2 / 2

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

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

Seq Scan on contract_protectionservice cps (cost=0..1.76 rows=8 width=12) (actual time=0.01..0.016 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.005 0.017 ↑ 1.0 3 2 / 2

Hash (cost=1.1..1.1 rows=3 width=4) (actual time=0.016..0.017 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=12) (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 : 61.726 ms
Execution time : 786.733 ms