explain.depesz.com

PostgreSQL's explain analyze made readable

Result: pjOB

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

Limit (cost=72.44..72.47 rows=1 width=586) (actual time=3,441.992..3,442.046 rows=40 loops=1)

  • Buffers: shared hit=3,605,794
2. 0.051 3,442.029 ↓ 41.0 41 1

GroupAggregate (cost=72.4..72.44 rows=1 width=586) (actual time=3,441.988..3,442.029 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,605,794
3. 248.863 3,441.978 ↓ 105.0 105 1

Sort (cost=72.4..72.4 rows=1 width=586) (actual time=3,441.968..3,441.978 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,605,794
4. 149.037 3,193.115 ↓ 125,904.0 125,904 1

Nested Loop (cost=4.74..72.39 rows=1 width=586) (actual time=0.243..3,193.115 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,605,794
5. 137.181 3,044.078 ↓ 125,904.0 125,904 1

Nested Loop (cost=4.59..71.9 rows=1 width=198) (actual time=0.229..3,044.078 rows=125,904 loops=1)

  • Buffers: shared hit=3,479,890
6. 138.488 2,906.897 ↓ 125,904.0 125,904 1

Nested Loop (cost=4.45..63.73 rows=1 width=198) (actual time=0.212..2,906.897 rows=125,904 loops=1)

  • Buffers: shared hit=3,353,986
7. 149.676 2,768.409 ↓ 125,904.0 125,904 1

Nested Loop (cost=4.3..63.55 rows=1 width=198) (actual time=0.199..2,768.409 rows=125,904 loops=1)

  • Buffers: shared hit=3,228,082
8. 122.702 2,618.733 ↓ 125,904.0 125,904 1

Nested Loop (cost=4.16..63.33 rows=1 width=198) (actual time=0.185..2,618.733 rows=125,904 loops=1)

  • Buffers: shared hit=3,102,178
9. 124.450 2,496.031 ↓ 125,904.0 125,904 1

Nested Loop (cost=3.87..57.18 rows=1 width=144) (actual time=0.171..2,496.031 rows=125,904 loops=1)

  • Buffers: shared hit=3,055,375
10. 97.816 2,371.581 ↓ 125,904.0 125,904 1

Nested Loop (cost=3.58..56.77 rows=1 width=148) (actual time=0.156..2,371.581 rows=125,904 loops=1)

  • Buffers: shared hit=3,008,572
11. 74.827 2,147.861 ↓ 125,904.0 125,904 1

Nested Loop (cost=3.29..56.4 rows=1 width=90) (actual time=0.143..2,147.861 rows=125,904 loops=1)

  • Filter: ((cl.linkid IS NULL) OR cl.hasminimumdata)
  • Buffers: shared hit=2,677,663
12. 145.720 1,947.104 ↓ 125,930.0 125,930 1

Nested Loop (cost=2.86..47.96 rows=1 width=102) (actual time=0.134..1,947.104 rows=125,930 loops=1)

  • Buffers: shared hit=2,521,095
13. 124.833 1,675.454 ↓ 125,930.0 125,930 1

Nested Loop (cost=2.57..47.64 rows=1 width=74) (actual time=0.122..1,675.454 rows=125,930 loops=1)

  • Buffers: shared hit=2,143,305
14. 138.910 1,424.691 ↓ 125,930.0 125,930 1

Nested Loop (cost=2.28..47.33 rows=1 width=82) (actual time=0.108..1,424.691 rows=125,930 loops=1)

  • Buffers: shared hit=1,765,515
15. 151.947 1,159.851 ↓ 125,930.0 125,930 1

Nested Loop (cost=2..47 rows=1 width=74) (actual time=0.094..1,159.851 rows=125,930 loops=1)

  • Buffers: shared hit=1,387,725
16. 116.139 755.974 ↓ 125,965.0 125,965 1

Nested Loop (cost=1.56..46.32 rows=1 width=66) (actual time=0.077..755.974 rows=125,965 loops=1)

  • Buffers: shared hit=883,179
17. 129.376 387.905 ↓ 125,965.0 125,965 1

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

  • Buffers: shared hit=378,623
18. 17.334 132.564 ↓ 125,965.0 125,965 1

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

  • Buffers: shared hit=728
19. 0.038 0.038 ↓ 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.021..0.038 rows=8 loops=1)

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

Index Scan using incident__index1 on incident i (cost=0.56..8.59 rows=1 width=28) (actual time=0.018..14.399 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
21. 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
22. 251.930 251.930 ↑ 1.0 1 125,965

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

  • Index Cond: ((dl.detectionlinkid = i.detectionlinkid) AND (dl.linktypeid = 1))
  • Buffers: shared hit=504,556
23. 251.930 251.930 ↑ 1.0 1 125,965

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

  • Index Cond: ((l.linkid = dl.detectionlinkid) AND (l.linktypeid = 1))
  • Filter: (l.hasminimumdata AND (NOT l.deleted) AND (l.customerid = 594) AND (l.enforcementstatusid = 6))
  • 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 Scan using idx_contract_asset__asset on contract_asset coa (cost=0.28..0.3 rows=1 width=8) (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
26. 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
27. 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=156,568
28. 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
29. 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
30. 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
31. 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
32. 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
33. 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
34. 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 : 102.381 ms
Execution time : 3,443.629 ms