explain.depesz.com

PostgreSQL's explain analyze made readable

Result: oE9R

Settings
# exclusive inclusive rows x rows loops node
1. 0.011 2,345.696 ↓ 40.0 40 1

Limit (cost=543.48..543.52 rows=1 width=586) (actual time=2,345.666..2,345.696 rows=40 loops=1)

2. 0.029 2,345.685 ↓ 40.0 40 1

GroupAggregate (cost=543.48..543.52 rows=1 width=586) (actual time=2,345.665..2,345.685 rows=40 loops=1)

  • Group Key: dl.highrisk, dl.createdat, l.linkid, d.url, (COALESCE(cfg.icon, mcfg.icon)), (COALESCE(cfg.channelid, mcfg.channelid)), a.assetid, i.incidentstatusid
3. 1.840 2,345.656 ↓ 50.0 50 1

Sort (cost=543.48..543.49 rows=1 width=586) (actual time=2,345.653..2,345.656 rows=50 loops=1)

  • Sort Key: dl.highrisk DESC, dl.createdat, l.linkid, d.url, (COALESCE(cfg.icon, mcfg.icon)), (COALESCE(cfg.channelid, mcfg.channelid)), a.assetid
  • Sort Method: quicksort Memory: 213kB
4. 1.791 2,343.816 ↓ 1,168.0 1,168 1

Nested Loop Left Join (cost=5.00..543.47 rows=1 width=586) (actual time=0.414..2,343.816 rows=1,168 loops=1)

  • Join Filter: (cc.customerdivisionid = c.customerdivisionid)
  • Filter: (((c.customerdivisionid IS NOT NULL) AND (dc.domainid IS NOT NULL) AND (cc.scopeid IS NOT NULL) AND (ccd.contractid IS NOT NULL)) OR (c.customerdivisionid IS NULL))
5. 1.323 2,342.025 ↓ 1,168.0 1,168 1

Nested Loop Left Join (cost=4.85..542.99 rows=1 width=202) (actual time=0.403..2,342.025 rows=1,168 loops=1)

  • Join Filter: (co.contractid = ccd.contractid)
6. 0.602 2,340.702 ↓ 1,168.0 1,168 1

Nested Loop Left Join (cost=4.71..541.93 rows=1 width=202) (actual time=0.393..2,340.702 rows=1,168 loops=1)

  • Join Filter: (c.customerdivisionid = dc.customerdivisionid)
7. 0.530 2,338.932 ↓ 1,168.0 1,168 1

Nested Loop Left Join (cost=4.56..541.76 rows=1 width=202) (actual time=0.385..2,338.932 rows=1,168 loops=1)

  • Join Filter: (c.customerid = co.customerid)
8. 1.742 2,338.402 ↓ 1,168.0 1,168 1

Nested Loop Left Join (cost=4.56..530.63 rows=1 width=202) (actual time=0.380..2,338.402 rows=1,168 loops=1)

9. 0.708 2,336.660 ↓ 1,168.0 1,168 1

Nested Loop Left Join (cost=4.27..524.51 rows=1 width=146) (actual time=0.373..2,336.660 rows=1,168 loops=1)

  • Join Filter: (d.domainconfigurationid IS NULL)
10. 1.325 2,334.784 ↓ 1,168.0 1,168 1

Nested Loop Left Join (cost=3.98..524.10 rows=1 width=150) (actual time=0.365..2,334.784 rows=1,168 loops=1)

11. 0.824 2,332.291 ↓ 1,168.0 1,168 1

Nested Loop (cost=3.69..523.73 rows=1 width=90) (actual time=0.352..2,332.291 rows=1,168 loops=1)

12. 0.525 2,329.131 ↓ 1,168.0 1,168 1

Nested Loop (cost=3.40..523.42 rows=1 width=62) (actual time=0.335..2,329.131 rows=1,168 loops=1)

13. 0.694 2,326.270 ↓ 1,168.0 1,168 1

Nested Loop (cost=3.13..515.11 rows=1 width=62) (actual time=0.321..2,326.270 rows=1,168 loops=1)

14. 1.164 2,323.240 ↓ 1,168.0 1,168 1

Nested Loop Left Join (cost=2.85..506.81 rows=1 width=58) (actual time=0.308..2,323.240 rows=1,168 loops=1)

  • Filter: ((cl.linkid IS NULL) OR cl.hasminimumdata)
  • Rows Removed by Filter: 2
15. 96.602 2,320.906 ↓ 1,170.0 1,170 1

Nested Loop (cost=2.42..499.03 rows=1 width=62) (actual time=0.299..2,320.906 rows=1,170 loops=1)

16. 567.712 1,587.714 ↓ 318,295.0 318,295 1

Nested Loop (cost=1.85..498.14 rows=1 width=54) (actual time=0.095..1,587.714 rows=318,295 loops=1)

17. 75.891 476.882 ↓ 543,120.0 543,120 1

Nested Loop (cost=1.42..496.53 rows=1 width=41) (actual time=0.081..476.882 rows=543,120 loops=1)

  • Join Filter: (a.assetid = l.assetid)
18. 0.030 0.199 ↓ 8.0 8 1

Nested Loop (cost=0.85..29.75 rows=1 width=37) (actual time=0.056..0.199 rows=8 loops=1)

  • Join Filter: (a.assetid = coa.assetid)
19. 0.031 0.121 ↓ 4.0 8 1

Nested Loop (cost=0.57..29.02 rows=2 width=29) (actual time=0.040..0.121 rows=8 loops=1)

20. 0.042 0.042 ↓ 4.0 8 1

Index Scan using idx_asset_customer on asset a (cost=0.28..12.40 rows=2 width=21) (actual time=0.027..0.042 rows=8 loops=1)

  • Index Cond: (customerid = 594)
  • Filter: active
21. 0.048 0.048 ↑ 1.0 1 8

Index Only Scan using uq_asset_scope on asset_scope ascope (cost=0.29..8.31 rows=1 width=8) (actual time=0.006..0.006 rows=1 loops=8)

  • Index Cond: ((assetid = a.assetid) AND (scopeid = 1))
  • Heap Fetches: 8
22. 0.048 0.048 ↑ 1.0 1 8

Index Scan using idx_contract_asset__asset on contract_asset coa (cost=0.28..0.36 rows=1 width=8) (actual time=0.006..0.006 rows=1 loops=8)

  • Index Cond: (assetid = ascope.assetid)
  • Filter: (contractid = 614)
23. 400.792 400.792 ↓ 197.4 67,890 8

Index Scan using idx_link_enforcementstatus_customer_asset_minimumdata on link l (cost=0.56..462.48 rows=344 width=16) (actual time=0.021..50.099 rows=67,890 loops=8)

  • Index Cond: ((enforcementstatusid = 6) AND (customerid = 594) AND (assetid = ascope.assetid) AND (hasminimumdata = true))
  • Filter: ((NOT deleted) AND hasminimumdata)
24. 543.120 543.120 ↑ 1.0 1 543,120

Index Scan using idx_detectionlink_link on detectionlink dl (cost=0.43..1.61 rows=1 width=13) (actual time=0.001..0.001 rows=1 loops=543,120)

  • Index Cond: (detectionlinkid = l.linkid)
25. 636.590 636.590 ↓ 0.0 0 318,295

Index Scan using idx_incident_incidentstatus_customer_detectionlinkid on incident i (cost=0.56..0.88 rows=1 width=16) (actual time=0.002..0.002 rows=0 loops=318,295)

  • Index Cond: ((incidentstatusid = 2) AND (customerid = 594) AND (detectionlinkid = dl.detectionlinkid))
  • Filter: ((NOT deleted) AND (enforcementlevelid = 8))
  • Rows Removed by Filter: 0
26. 1.170 1.170 ↓ 0.0 0 1,170

Index Scan using uq_link_linkid_linktypeid on link cl (cost=0.44..7.77 rows=1 width=5) (actual time=0.001..0.001 rows=0 loops=1,170)

  • Index Cond: (linkid = i.contentlinkid)
  • Filter: (customerid = 594)
27. 2.336 2.336 ↑ 1.0 1 1,168

Index Scan using pk_contract on contract co (cost=0.28..8.29 rows=1 width=8) (actual time=0.001..0.002 rows=1 loops=1,168)

  • Index Cond: (contractid = 614)
  • Filter: active
28. 2.336 2.336 ↑ 1.0 1 1,168

Index Only Scan using pk_scope on scope (cost=0.28..8.29 rows=1 width=4) (actual time=0.001..0.002 rows=1 loops=1,168)

  • Index Cond: (scopeid = 1)
  • Heap Fetches: 1,168
29. 2.336 2.336 ↑ 1.0 1 1,168

Index Scan using uq_domain_domainid_domaintypeid on domain d (cost=0.29..0.31 rows=1 width=32) (actual time=0.002..0.002 rows=1 loops=1,168)

  • Index Cond: (domainid = l.domainid)
  • Filter: active
30. 1.168 1.168 ↑ 1.0 1 1,168

Index Scan using pk_domainconfiguration on domainconfiguration cfg (cost=0.29..0.37 rows=1 width=64) (actual time=0.001..0.001 rows=1 loops=1,168)

  • Index Cond: (domainconfigurationid = d.domainconfigurationid)
31. 1.168 1.168 ↓ 0.0 0 1,168

Index Scan using uq_domain_domainid_domaintypeid on domain md (cost=0.29..0.40 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=1,168)

  • Index Cond: (domainid = d.masterdomainid)
  • Filter: (hierarchylevelid = 1)
32. 0.000 0.000 ↓ 0.0 0 1,168

Index Scan using pk_domainconfiguration on domainconfiguration mcfg (cost=0.29..6.12 rows=1 width=64) (actual time=0.000..0.000 rows=0 loops=1,168)

  • Index Cond: (domainconfigurationid = md.domainconfigurationid)
33. 0.000 0.000 ↓ 0.0 0 1,168

Seq Scan on customerdivision c (cost=0.00..10.50 rows=50 width=8) (actual time=0.000..0.000 rows=0 loops=1,168)

34. 1.168 1.168 ↓ 0.0 0 1,168

Index Scan using idx_domaincustomerdivision_domain on domain_customerdivision dc (cost=0.14..0.16 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=1,168)

  • Index Cond: (d.domainid = domainid)
35. 0.000 0.000 ↓ 0.0 0 1,168

Index Scan using idx_contractcustomerdivision_customerdivision on contract_customerdivision ccd (cost=0.14..1.04 rows=1 width=8) (actual time=0.000..0.000 rows=0 loops=1,168)

  • Index Cond: (customerdivisionid = c.customerdivisionid)
  • Filter: (contractid = 614)
36. 0.000 0.000 ↓ 0.0 0 1,168

Index Scan using idx_customerdivisionscope_scope on customerdivision_scope cc (cost=0.15..0.36 rows=10 width=8) (actual time=0.000..0.000 rows=0 loops=1,168)

  • Index Cond: ((scopeid = ascope.scopeid) AND (scopeid = 1))
Planning time : 21.441 ms
Execution time : 2,345.961 ms