explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 160

Settings
# exclusive inclusive rows x rows loops node
1. 0.015 4,781.964 ↓ 20.0 20 1

Limit (cost=541.11..541.15 rows=1 width=586) (actual time=4,781.93..4,781.964 rows=20 loops=1)

  • Buffers: shared hit=5315947
2. 0.038 4,781.949 ↓ 21.0 21 1

GroupAggregate (cost=541.07..541.11 rows=1 width=586) (actual time=4,781.926..4,781.949 rows=21 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=5315947
3. 262.014 4,781.911 ↓ 60.0 60 1

Sort (cost=541.07..541.08 rows=1 width=586) (actual time=4,781.905..4,781.911 rows=60 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=5315947
4. 151.194 4,519.897 ↓ 125,904.0 125,904 1

Nested Loop (cost=5..541.06 rows=1 width=586) (actual time=0.282..4,519.897 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=5315947
5. 106.267 4,368.703 ↓ 125,904.0 125,904 1

Nested Loop (cost=4.85..540.57 rows=1 width=198) (actual time=0.268..4,368.703 rows=125,904 loops=1)

  • Buffers: shared hit=5190043
6. 152.030 4,262.436 ↓ 125,904.0 125,904 1

Nested Loop (cost=4.71..539.52 rows=1 width=198) (actual time=0.256..4,262.436 rows=125,904 loops=1)

  • Buffers: shared hit=5190043
7. 44.808 4,110.406 ↓ 125,904.0 125,904 1

Nested Loop (cost=4.56..539.35 rows=1 width=198) (actual time=0.241..4,110.406 rows=125,904 loops=1)

  • Buffers: shared hit=5064139
8. 122.120 4,065.598 ↓ 125,904.0 125,904 1

Nested Loop (cost=4.56..528.22 rows=1 width=198) (actual time=0.236..4,065.598 rows=125,904 loops=1)

  • Buffers: shared hit=5064139
9. 129.860 3,943.478 ↓ 125,904.0 125,904 1

Nested Loop (cost=4.27..522.07 rows=1 width=144) (actual time=0.221..3,943.478 rows=125,904 loops=1)

  • Buffers: shared hit=5017336
10. 102.396 3,813.618 ↓ 125,904.0 125,904 1

Nested Loop (cost=3.98..521.66 rows=1 width=148) (actual time=0.205..3,813.618 rows=125,904 loops=1)

  • Buffers: shared hit=4970533
11. 140.663 3,585.318 ↓ 125,904.0 125,904 1

Nested Loop (cost=3.69..521.29 rows=1 width=90) (actual time=0.194..3,585.318 rows=125,904 loops=1)

  • Buffers: shared hit=4639624
12. 121.296 3,318.751 ↓ 125,904.0 125,904 1

Nested Loop (cost=3.4..520.98 rows=1 width=62) (actual time=0.177..3,318.751 rows=125,904 loops=1)

  • Buffers: shared hit=4261912
13. 135.893 3,071.551 ↓ 125,904.0 125,904 1

Nested Loop (cost=3.13..512.68 rows=1 width=62) (actual time=0.158..3,071.551 rows=125,904 loops=1)

  • Buffers: shared hit=3884200
14. 100.198 2,809.754 ↓ 125,904.0 125,904 1

Nested Loop (cost=2.85..504.38 rows=1 width=58) (actual time=0.144..2,809.754 rows=125,904 loops=1)

  • Filter: ((cl.linkid IS NULL) OR cl.hasminimumdata)
  • Buffers: shared hit=3506488
15. 289.721 2,583.626 ↓ 125,930.0 125,930 1

Nested Loop (cost=2.42..496.43 rows=1 width=62) (actual time=0.135..2,583.626 rows=125,930 loops=1)

  • Buffers: shared hit=3349920
16. 77.800 1,657.315 ↓ 318,295.0 318,295 1

Nested Loop (cost=1.85..495.54 rows=1 width=54) (actual time=0.102..1,657.315 rows=318,295 loops=1)

  • Buffers: shared hit=1952233
17. 82.246 493.275 ↓ 543,120.0 543,120 1

Nested Loop (cost=1.42..493.96 rows=1 width=41) (actual time=0.087..493.275 rows=543,120 loops=1)

  • Buffers: shared hit=2237
18. 0.037 0.205 ↓ 8.0 8 1

Nested Loop (cost=0.85..29.76 rows=1 width=37) (actual time=0.059..0.205 rows=8 loops=1)

  • Buffers: shared hit=52
19. 0.033 0.128 ↓ 4.0 8 1

Nested Loop (cost=0.57..29.03 rows=2 width=29) (actual time=0.045..0.128 rows=8 loops=1)

  • Buffers: shared hit=28
20. 0.039 0.039 ↓ 4.0 8 1

Index Scan using idx_asset_customer on asset a (cost=0.28..12.41 rows=2 width=21) (actual time=0.024..0.039 rows=8 loops=1)

  • Index Cond: (a.customerid = 594)
  • Filter: a.active
  • Buffers: shared hit=4
21. 0.056 0.056 ↑ 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.007..0.007 rows=1 loops=8)

  • Index Cond: ((ascope.assetid = a.assetid) AND (ascope.scopeid = 1))
  • Heap Fetches: 8
  • Buffers: shared hit=24
22. 0.040 0.040 ↑ 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.005..0.005 rows=1 loops=8)

  • Index Cond: (coa.assetid = ascope.assetid)
  • Filter: (coa.contractid = 614)
  • Buffers: shared hit=24
23. 410.824 410.824 ↓ 192.9 67,890 8

Index Scan using idx_link_enforcementstatus_customer_asset_minimumdata on link l (cost=0.56..459.8 rows=352 width=16) (actual time=0.019..51.353 rows=67,890 loops=8)

  • Index Cond: ((l.enforcementstatusid = 6) AND (l.customerid = 594) AND (l.assetid = ascope.assetid) AND (l.hasminimumdata = true))
  • Filter: ((NOT l.deleted) AND l.hasminimumdata)
  • Buffers: shared hit=2185
24. 1,086.240 1,086.240 ↑ 1.0 1 543,120

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

  • Index Cond: (dl.detectionlinkid = l.linkid)
  • Buffers: shared hit=1949996
25. 636.590 636.590 ↓ 0.0 0 318,295

Index Scan using idx_incident_incidentstatus_customer_detectionlinkid_enforcemen 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: ((i.incidentstatusid = 12) AND (i.customerid = 594) AND (i.detectionlinkid = dl.detectionlinkid) AND (i.enforcementlevelid = 8))
  • Buffers: shared hit=1397687
26. 125.930 125.930 ↓ 0.0 0 125,930

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

  • Index Cond: (cl.linkid = i.contentlinkid)
  • Filter: (cl.customerid = 594)
  • Buffers: shared hit=156568
27. 125.904 125.904 ↑ 1.0 1 125,904

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

  • Index Cond: (co.contractid = 614)
  • Filter: co.active
  • Buffers: shared hit=377712
28. 125.904 125.904 ↑ 1.0 1 125,904

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

  • Index Cond: (scope.scopeid = 1)
  • Heap Fetches: 125904
  • Buffers: shared hit=377712
29. 125.904 125.904 ↑ 1.0 1 125,904

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

  • Index Cond: (d.domainid = l.domainid)
  • Filter: d.active
  • Buffers: shared hit=377712
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

Seq Scan on customerdivision c (cost=0..10.5 rows=50 width=8) (actual time=0..0 rows=0 loops=125,904)

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 Scan using idx_contractcustomerdivision_customerdivision on contract_customerdivision ccd (cost=0.14..1.04 rows=1 width=8) (actual time=0..0 rows=0 loops=125,904)

  • Index Cond: (ccd.customerdivisionid = c.customerdivisionid)
  • Filter: (ccd.contractid = 614)
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 : 22.179 ms
Execution time : 4,783.449 ms