explain.depesz.com

PostgreSQL's explain analyze made readable

Result: fDOj

Settings
# exclusive inclusive rows x rows loops node
1. 0.017 3,689.929 ↓ 40.0 40 1

Limit (cost=82.33..82.37 rows=1 width=586) (actual time=3,689.874..3,689.929 rows=40 loops=1)

  • Buffers: shared hit=3983444
2. 0.050 3,689.912 ↓ 41.0 41 1

GroupAggregate (cost=82.29..82.33 rows=1 width=586) (actual time=3,689.87..3,689.912 rows=41 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
  • Buffers: shared hit=3983444
3. 248.578 3,689.862 ↓ 105.0 105 1

Sort (cost=82.29..82.3 rows=1 width=586) (actual time=3,689.852..3,689.862 rows=105 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: 20778kB
  • Buffers: shared hit=3983444
4. 148.971 3,441.284 ↓ 125,904.0 125,904 1

Nested Loop (cost=5.01..82.28 rows=1 width=586) (actual time=0.259..3,441.284 rows=125,904 loops=1)

  • 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))
  • Buffers: shared hit=3983444
5. 127.262 3,292.313 ↓ 125,904.0 125,904 1

Nested Loop (cost=4.86..81.8 rows=1 width=198) (actual time=0.245..3,292.313 rows=125,904 loops=1)

  • Buffers: shared hit=3857540
6. 136.248 3,165.051 ↓ 125,904.0 125,904 1

Nested Loop (cost=4.72..73.62 rows=1 width=198) (actual time=0.232..3,165.051 rows=125,904 loops=1)

  • Buffers: shared hit=3731636
7. 149.542 3,028.803 ↓ 125,904.0 125,904 1

Nested Loop (cost=4.58..73.45 rows=1 width=198) (actual time=0.218..3,028.803 rows=125,904 loops=1)

  • Buffers: shared hit=3605732
8. 116.697 2,879.261 ↓ 125,904.0 125,904 1

Nested Loop (cost=4.44..73.22 rows=1 width=198) (actual time=0.2..2,879.261 rows=125,904 loops=1)

  • Buffers: shared hit=3479828
9. 121.739 2,762.564 ↓ 125,904.0 125,904 1

Nested Loop (cost=4.15..67.08 rows=1 width=144) (actual time=0.185..2,762.564 rows=125,904 loops=1)

  • Buffers: shared hit=3433025
10. 103.432 2,640.825 ↓ 125,904.0 125,904 1

Nested Loop (cost=3.86..66.67 rows=1 width=148) (actual time=0.17..2,640.825 rows=125,904 loops=1)

  • Buffers: shared hit=3386222
11. 82.804 2,411.489 ↓ 125,904.0 125,904 1

Nested Loop (cost=3.57..66.3 rows=1 width=90) (actual time=0.159..2,411.489 rows=125,904 loops=1)

  • Filter: ((cl.linkid IS NULL) OR cl.hasminimumdata)
  • Buffers: shared hit=3055313
12. 119.485 2,202.755 ↓ 125,930.0 125,930 1

Nested Loop (cost=3.13..57.85 rows=1 width=102) (actual time=0.145..2,202.755 rows=125,930 loops=1)

  • Buffers: shared hit=2898745
13. 141.243 1,831.410 ↓ 125,930.0 125,930 1

Nested Loop (cost=2.7..55.62 rows=1 width=97) (actual time=0.13..1,831.41 rows=125,930 loops=1)

  • Buffers: shared hit=2394329
14. 129.972 1,564.237 ↓ 125,930.0 125,930 1

Nested Loop (cost=2.41..55.3 rows=1 width=69) (actual time=0.118..1,564.237 rows=125,930 loops=1)

  • Buffers: shared hit=2016539
15. 121.278 1,308.335 ↓ 125,930.0 125,930 1

Nested Loop (cost=2.12..54.99 rows=1 width=77) (actual time=0.106..1,308.335 rows=125,930 loops=1)

  • Buffers: shared hit=1638749
16. 138.686 1,061.127 ↓ 125,930.0 125,930 1

Nested Loop (cost=1.85..46.69 rows=1 width=77) (actual time=0.093..1,061.127 rows=125,930 loops=1)

  • Buffers: shared hit=1260959
17. 161.851 796.511 ↓ 125,930.0 125,930 1

Nested Loop (cost=1.56..46.36 rows=1 width=69) (actual time=0.079..796.511 rows=125,930 loops=1)

  • Buffers: shared hit=883169
18. 122.848 382.730 ↓ 125,965.0 125,965 1

Nested Loop (cost=1.12..37.92 rows=1 width=53) (actual time=0.057..382.73 rows=125,965 loops=1)

  • Buffers: shared hit=378623
19. 17.832 133.917 ↓ 125,965.0 125,965 1

Nested Loop (cost=0.85..29.61 rows=1 width=49) (actual time=0.044..133.917 rows=125,965 loops=1)

  • Buffers: shared hit=728
20. 0.037 0.037 ↓ 4.0 8 1

Index Scan using idx_asset_customer on asset a (cost=0.28..12.41 rows=2 width=25) (actual time=0.023..0.037 rows=8 loops=1)

  • Index Cond: (a.customerid = 594)
  • Filter: a.active
  • Buffers: shared hit=4
21. 116.048 116.048 ↓ 15,746.0 15,746 8

Index Scan using incident__index1 on incident i (cost=0.56..8.59 rows=1 width=24) (actual time=0.018..14.506 rows=15,746 loops=8)

  • Index Cond: ((i.customerid = 594) AND (i.contractid = 614) AND (i.assetid = a.assetid) AND (i.incidentstatusid = 12) AND (i.enforcementlevelid = 8))
  • Buffers: shared hit=724
22. 125.965 125.965 ↑ 1.0 1 125,965

Index Only Scan using idx_contract_contractid__active on contract co (cost=0.28..8.29 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=125,965)

  • Index Cond: (co.contractid = 614)
  • Heap Fetches: 125965
  • Buffers: shared hit=377895
23. 251.930 251.930 ↑ 1.0 1 125,965

Index Scan using uq_link_linkid_linktypeid on link l (cost=0.44..8.44 rows=1 width=20) (actual time=0.002..0.002 rows=1 loops=125,965)

  • Index Cond: ((l.linkid = i.detectionlinkid) AND (l.linktypeid = 1))
  • Filter: (l.hasminimumdata AND (NOT l.deleted) AND (l.enforcementstatusid = 6) AND (l.customerid = 594) AND (i.assetid = l.assetid))
  • Buffers: shared hit=504546
24. 125.930 125.930 ↑ 1.0 1 125,930

Index Only Scan using uq_asset_scope on asset_scope ascope (cost=0.29..0.31 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=125,930)

  • Index Cond: ((ascope.assetid = l.assetid) AND (ascope.scopeid = 1))
  • Heap Fetches: 125930
  • Buffers: shared hit=377790
25. 125.930 125.930 ↑ 1.0 1 125,930

Index Only Scan using pk_scope on scope scope (cost=0.28..8.29 rows=1 width=0) (actual time=0.001..0.001 rows=1 loops=125,930)

  • Index Cond: (scope.scopeid = 1)
  • Heap Fetches: 125930
  • Buffers: shared hit=377790
26. 125.930 125.930 ↑ 1.0 1 125,930

Index Scan using idx_contract_asset__asset on contract_asset coa (cost=0.28..0.3 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=125,930)

  • Index Cond: (coa.assetid = l.assetid)
  • Filter: (coa.contractid = 614)
  • Buffers: shared hit=377790
27. 125.930 125.930 ↑ 1.0 1 125,930

Index Scan using uq_domain_domainid_domaintypeid on domain d (cost=0.29..0.32 rows=1 width=32) (actual time=0.001..0.001 rows=1 loops=125,930)

  • Index Cond: (d.domainid = l.domainid)
  • Filter: d.active
  • Buffers: shared hit=377790
28. 251.860 251.860 ↑ 1.0 1 125,930

Index Scan using idx_detection_link on detectionlink dl (cost=0.43..2.23 rows=1 width=13) (actual time=0.002..0.002 rows=1 loops=125,930)

  • Index Cond: ((dl.detectionlinkid = l.linkid) AND (dl.linktypeid = 1))
  • Buffers: shared hit=504416
29. 125.930 125.930 ↓ 0.0 0 125,930

Index Scan using uq_link_linkid_linktypeid on link cl (cost=0.44..8.43 rows=1 width=13) (actual time=0.001..0.001 rows=0 loops=125,930)

  • Index Cond: ((cl.linkid = i.contentlinkid) AND (cl.linktypeid = 2))
  • Filter: ((NOT cl.deleted) AND (cl.customerid = 594))
  • Buffers: shared hit=156568
30. 125.904 125.904 ↑ 1.0 1 125,904

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

  • Index Cond: (cfg.domainconfigurationid = d.domainconfigurationid)
  • Buffers: shared hit=330909
31. 0.000 0.000 ↓ 0.0 0 125,904

Index Scan using uq_domain_domainid_domaintypeid on domain md (cost=0.29..0.4 rows=1 width=8) (actual time=0..0 rows=0 loops=125,904)

  • Index Cond: (md.domainid = d.masterdomainid)
  • Filter: (md.hierarchylevelid = 1)
  • Buffers: shared hit=46803
32. 0.000 0.000 ↓ 0.0 0 125,904

Index Scan using pk_domainconfiguration on domainconfiguration mcfg (cost=0.29..6.15 rows=1 width=62) (actual time=0..0 rows=0 loops=125,904)

  • Index Cond: (mcfg.domainconfigurationid = md.domainconfigurationid)
  • Buffers: shared hit=46803
33. 0.000 0.000 ↓ 0.0 0 125,904

Index Scan using idx_customerdivision_customer on customerdivision c (cost=0.14..0.21 rows=1 width=8) (actual time=0..0 rows=0 loops=125,904)

  • Index Cond: ((c.customerid = i.customerid) AND (c.customerid = 594))
  • Buffers: shared hit=125904
34. 0.000 0.000 ↓ 0.0 0 125,904

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

  • Index Cond: (d.domainid = dc.domainid)
  • Buffers: shared hit=125904
35. 0.000 0.000 ↓ 0.0 0 125,904

Index Only Scan using uq_contract_customerdivision__contract_customerdivision on contract_customerdivision ccd (cost=0.14..8.16 rows=1 width=8) (actual time=0..0 rows=0 loops=125,904)

  • Index Cond: (ccd.contractid = 614)
  • Buffers: shared hit=125904
36. 0.000 0.000 ↓ 0.0 0 125,904

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

  • Index Cond: ((cc.scopeid = ascope.scopeid) AND (cc.scopeid = 1))
  • Buffers: shared hit=125904
Planning time : 87.392 ms
Execution time : 3,691.351 ms