explain.depesz.com

PostgreSQL's explain analyze made readable

Result: rzbf

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

Limit (cost=541.06..541.1 rows=1 width=586) (actual time=4,889.184..4,889.218 rows=20 loops=1)

  • Buffers: shared hit=4640866
2. 0.038 4,889.203 ↓ 21.0 21 1

GroupAggregate (cost=541.03..541.06 rows=1 width=586) (actual time=4,889.181..4,889.203 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=4640866
3. 272.874 4,889.165 ↓ 60.0 60 1

Sort (cost=541.03..541.03 rows=1 width=586) (actual time=4,889.16..4,889.165 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=4640866
4. 171.595 4,616.291 ↓ 125,904.0 125,904 1

Nested Loop (cost=5..541.02 rows=1 width=586) (actual time=0.247..4,616.291 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=4640866
5. 118.799 4,444.696 ↓ 125,904.0 125,904 1

Nested Loop (cost=4.85..540.53 rows=1 width=198) (actual time=0.235..4,444.696 rows=125,904 loops=1)

  • Buffers: shared hit=4514962
6. 166.150 4,325.897 ↓ 125,904.0 125,904 1

Nested Loop (cost=4.71..539.47 rows=1 width=198) (actual time=0.224..4,325.897 rows=125,904 loops=1)

  • Buffers: shared hit=4514962
7. 53.184 4,159.747 ↓ 125,904.0 125,904 1

Nested Loop (cost=4.56..539.3 rows=1 width=198) (actual time=0.213..4,159.747 rows=125,904 loops=1)

  • Buffers: shared hit=4389058
8. 144.263 4,106.563 ↓ 125,904.0 125,904 1

Nested Loop (cost=4.56..528.18 rows=1 width=198) (actual time=0.208..4,106.563 rows=125,904 loops=1)

  • Buffers: shared hit=4389058
9. 143.272 3,962.300 ↓ 125,904.0 125,904 1

Nested Loop (cost=4.27..522.03 rows=1 width=144) (actual time=0.195..3,962.3 rows=125,904 loops=1)

  • Buffers: shared hit=4342255
10. 123.055 3,819.028 ↓ 125,904.0 125,904 1

Nested Loop (cost=3.98..521.62 rows=1 width=148) (actual time=0.181..3,819.028 rows=125,904 loops=1)

  • Buffers: shared hit=4295452
11. 170.169 3,570.069 ↓ 125,904.0 125,904 1

Nested Loop (cost=3.69..521.25 rows=1 width=90) (actual time=0.173..3,570.069 rows=125,904 loops=1)

  • Buffers: shared hit=3964543
12. 152.316 3,273.996 ↓ 125,904.0 125,904 1

Nested Loop (cost=3.4..520.93 rows=1 width=62) (actual time=0.159..3,273.996 rows=125,904 loops=1)

  • Buffers: shared hit=3586831
13. 37.150 2,995.776 ↓ 125,904.0 125,904 1

Nested Loop (cost=3.13..512.63 rows=1 width=62) (actual time=0.147..2,995.776 rows=125,904 loops=1)

  • Buffers: shared hit=3209119
14. 119.125 2,706.818 ↓ 125,904.0 125,904 1

Nested Loop (cost=2.85..504.33 rows=1 width=58) (actual time=0.134..2,706.818 rows=125,904 loops=1)

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

Nested Loop (cost=2.42..496.38 rows=1 width=62) (actual time=0.125..2,461.763 rows=125,930 loops=1)

  • Buffers: shared hit=2674839
16. 293.703 1,413.515 ↓ 318,295.0 318,295 1

Nested Loop (cost=1.85..495.49 rows=1 width=54) (actual time=0.089..1,413.515 rows=318,295 loops=1)

  • Buffers: shared hit=1277152
17. 58.391 483.220 ↓ 318,296.0 318,296 1

Nested Loop (cost=1.42..493.3 rows=1 width=41) (actual time=0.076..483.22 rows=318,296 loops=1)

  • Buffers: shared hit=2237
18. 0.038 0.197 ↓ 8.0 8 1

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

  • Buffers: shared hit=52
19. 0.036 0.119 ↓ 4.0 8 1

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

  • Buffers: shared hit=28
20. 0.035 0.035 ↓ 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.018..0.035 rows=8 loops=1)

  • Index Cond: (a.customerid = 594)
  • Filter: a.active
  • Buffers: shared hit=4
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: ((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. 424.632 424.632 ↓ 173.7 39,787 8

Index Scan using idx_link_enforcementstatus_customer_asset_minimumdata on link l (cost=0.56..460.68 rows=229 width=16) (actual time=0.02..53.079 rows=39,787 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 AND (l.linktypeid = 1))
  • Buffers: shared hit=2185
24. 636.592 636.592 ↑ 1.0 1 318,296

Index Scan using idx_detection_link on detectionlink dl (cost=0.43..2.18 rows=1 width=13) (actual time=0.002..0.002 rows=1 loops=318,296)

  • Index Cond: ((dl.detectionlinkid = l.linkid) AND (dl.linktypeid = 1))
  • Buffers: shared hit=1274915
25. 954.885 954.885 ↓ 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.003..0.003 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. 251.808 251.808 ↑ 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.002 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.32 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 : 29.591 ms
Execution time : 4,890.842 ms