explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bwGQ

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

Limit (cost=82.39..82.43 rows=1 width=586) (actual time=3,668.278..3,668.331 rows=40 loops=1)

  • Buffers: shared hit=3,983,444
2. 0.048 3,668.314 ↓ 41.0 41 1

GroupAggregate (cost=82.35..82.39 rows=1 width=586) (actual time=3,668.274..3,668.314 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=3,983,444
3. 247.821 3,668.266 ↓ 105.0 105 1

Sort (cost=82.35..82.36 rows=1 width=586) (actual time=3,668.256..3,668.266 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: 20,778kB
  • Buffers: shared hit=3,983,444
4. 154.087 3,420.445 ↓ 125,904.0 125,904 1

Nested Loop (cost=5.01..82.34 rows=1 width=586) (actual time=0.225..3,420.445 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=3,983,444
5. 130.850 3,266.358 ↓ 125,904.0 125,904 1

Nested Loop (cost=4.86..81.86 rows=1 width=198) (actual time=0.211..3,266.358 rows=125,904 loops=1)

  • Buffers: shared hit=3,857,540
6. 139.680 3,135.508 ↓ 125,904.0 125,904 1

Nested Loop (cost=4.72..73.68 rows=1 width=198) (actual time=0.202..3,135.508 rows=125,904 loops=1)

  • Buffers: shared hit=3,731,636
7. 148.605 2,995.828 ↓ 125,904.0 125,904 1

Nested Loop (cost=4.58..73.51 rows=1 width=198) (actual time=0.193..2,995.828 rows=125,904 loops=1)

  • Buffers: shared hit=3,605,732
8. 117.461 2,847.223 ↓ 125,904.0 125,904 1

Nested Loop (cost=4.44..73.28 rows=1 width=198) (actual time=0.181..2,847.223 rows=125,904 loops=1)

  • Buffers: shared hit=3,479,828
9. 119.811 2,729.762 ↓ 125,904.0 125,904 1

Nested Loop (cost=4.15..67.14 rows=1 width=144) (actual time=0.17..2,729.762 rows=125,904 loops=1)

  • Buffers: shared hit=3,433,025
10. 99.553 2,609.951 ↓ 125,904.0 125,904 1

Nested Loop (cost=3.86..66.73 rows=1 width=148) (actual time=0.158..2,609.951 rows=125,904 loops=1)

  • Buffers: shared hit=3,386,222
11. 76.162 2,384.494 ↓ 125,904.0 125,904 1

Nested Loop (cost=3.57..66.36 rows=1 width=90) (actual time=0.15..2,384.494 rows=125,904 loops=1)

  • Filter: ((cl.linkid IS NULL) OR cl.hasminimumdata)
  • Buffers: shared hit=3,055,313
12. 120.932 2,182.402 ↓ 125,930.0 125,930 1

Nested Loop (cost=3.13..57.91 rows=1 width=98) (actual time=0.139..2,182.402 rows=125,930 loops=1)

  • Buffers: shared hit=2,898,745
13. 138.401 1,809.610 ↓ 125,930.0 125,930 1

Nested Loop (cost=2.7..55.62 rows=1 width=93) (actual time=0.124..1,809.61 rows=125,930 loops=1)

  • Buffers: shared hit=2,394,329
14. 124.877 1,545.279 ↓ 125,930.0 125,930 1

Nested Loop (cost=2.41..55.3 rows=1 width=65) (actual time=0.111..1,545.279 rows=125,930 loops=1)

  • Buffers: shared hit=2,016,539
15. 122.469 1,294.472 ↓ 125,930.0 125,930 1

Nested Loop (cost=2.12..54.99 rows=1 width=73) (actual time=0.098..1,294.472 rows=125,930 loops=1)

  • Buffers: shared hit=1,638,749
16. 132.653 1,046.073 ↓ 125,930.0 125,930 1

Nested Loop (cost=1.85..46.69 rows=1 width=73) (actual time=0.086..1,046.073 rows=125,930 loops=1)

  • Buffers: shared hit=1,260,959
17. 157.877 787.490 ↓ 125,930.0 125,930 1

Nested Loop (cost=1.56..46.36 rows=1 width=65) (actual time=0.074..787.49 rows=125,930 loops=1)

  • Buffers: shared hit=883,169
18. 118.810 377.683 ↓ 125,965.0 125,965 1

Nested Loop (cost=1.12..37.92 rows=1 width=49) (actual time=0.054..377.683 rows=125,965 loops=1)

  • Buffers: shared hit=378,623
19. 17.014 132.908 ↓ 125,965.0 125,965 1

Nested Loop (cost=0.85..29.61 rows=1 width=45) (actual time=0.042..132.908 rows=125,965 loops=1)

  • Buffers: shared hit=728
20. 0.030 0.030 ↓ 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.017..0.03 rows=8 loops=1)

  • Index Cond: (a.customerid = 594)
  • Filter: a.active
  • Buffers: shared hit=4
21. 115.864 115.864 ↓ 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.019..14.483 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: 125,965
  • Buffers: shared hit=377,895
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=16) (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=504,546
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: 125,930
  • Buffers: shared hit=377,790
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: 125,930
  • Buffers: shared hit=377,790
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=377,790
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=377,790
28. 251.860 251.860 ↑ 1.0 1 125,930

Index Scan using idx_detection_link on detectionlink dl (cost=0.43..2.29 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=504,416
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=9) (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=156,568
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=330,909
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=46,803
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=46,803
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=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=125,904
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=125,904
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=125,904
Planning time : 86.698 ms
Execution time : 3,669.592 ms