explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6YFu : Optimization for: Optimization for: plan #NtYB; plan #GWNr

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 3,710.204 ↑ 1.0 1 1

Limit (cost=8.68..33,432.04 rows=1 width=121) (actual time=3,710.203..3,710.204 rows=1 loops=1)

2.          

Initplan (for Limit)

3. 0.011 0.011 ↑ 1.0 1 1

Seq Scan on property_subtypes (cost=0.00..1.44 rows=1 width=8) (actual time=0.008..0.011 rows=1 loops=1)

  • Filter: ((code)::text = 'attached_doc'::text)
  • Rows Removed by Filter: 34
4. 0.008 0.008 ↑ 1.0 1 1

Seq Scan on property_statuses (cost=0.00..1.29 rows=1 width=8) (actual time=0.003..0.008 rows=1 loops=1)

  • Filter: ((description)::text = 'In Digital Files'::text)
  • Rows Removed by Filter: 22
5. 13.710 3,710.201 ↑ 185,731.0 1 1

Nested Loop (cost=5.95..6,207,754,032.95 rows=185,731 width=121) (actual time=3,710.201..3,710.201 rows=1 loops=1)

6. 38.450 3,696.474 ↑ 185,307.0 1 1

Nested Loop (cost=5.52..6,207,565,089.96 rows=185,307 width=97) (actual time=3,696.474..3,696.474 rows=1 loops=1)

  • Join Filter: (i.incidentnumber = c.incidentnumber)
  • Rows Removed by Join Filter: 444,320
7. 0.003 2,976.527 ↑ 40,281.0 1 1

Nested Loop (cost=5.52..4,034,284,025.67 rows=40,281 width=103) (actual time=2,976.527..2,976.527 rows=1 loops=1)

8. 377.336 2,976.487 ↑ 40,281.0 1 1

Nested Loop (cost=5.10..4,034,264,012.82 rows=40,281 width=89) (actual time=2,976.487..2,976.487 rows=1 loops=1)

  • Join Filter: (d.documentid = du.documentid)
  • Rows Removed by Join Filter: 3,716,498
9. 0.036 0.271 ↑ 786,351.5 2 1

Nested Loop (cost=0.43..966,870.17 rows=1,572,703 width=94) (actual time=0.177..0.271 rows=2 loops=1)

10. 0.003 0.003 ↑ 196,587.9 8 1

Seq Scan on doc_index di (cost=0.00..59,553.03 rows=1,572,703 width=69) (actual time=0.003..0.003 rows=8 loops=1)

11. 0.232 0.232 ↓ 0.0 0 8

Index Scan using yrk_attach_index on yrk_documentindex d (cost=0.43..0.57 rows=1 width=25) (actual time=0.029..0.029 rows=0 loops=8)

  • Index Cond: (documentid = split_part(di.filename, '.'::text, 1))
12. 731.200 2,598.880 ↓ 14.4 1,858,250 2

Materialize (cost=4.66..211,340.77 rows=128,962 width=13) (actual time=18.481..1,299.440 rows=1,858,250 loops=2)

13. 1,139.869 1,867.680 ↓ 23.6 3,046,230 1

Hash Join (cost=4.66..210,065.96 rows=128,962 width=13) (actual time=36.931..1,867.680 rows=3,046,230 loops=1)

  • Hash Cond: (du.usagetype = ut.usagetype)
14. 727.766 727.766 ↑ 1.0 5,585,212 1

Seq Scan on yrk_documentusage du (cost=0.00..187,815.40 rows=5,588,340 width=17) (actual time=36.827..727.766 rows=5,585,212 loops=1)

15. 0.005 0.045 ↑ 1.0 3 1

Hash (cost=4.62..4.62 rows=3 width=4) (actual time=0.045..0.045 rows=3 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
16. 0.040 0.040 ↑ 1.0 3 1

Seq Scan on yrk_globalusagetype ut (cost=0.00..4.62 rows=3 width=4) (actual time=0.016..0.040 rows=3 loops=1)

  • Filter: (usageid = 'IncidentID'::text)
  • Rows Removed by Filter: 127
17. 0.037 0.037 ↑ 1.0 1 1

Index Scan using yrk_incident_index on yrk_leincident i (cost=0.43..0.49 rows=1 width=18) (actual time=0.037..0.037 rows=1 loops=1)

  • Index Cond: (incidentid = du.usagekey)
18. 90.976 681.497 ↑ 5.8 444,321 1

Materialize (cost=0.00..378,779.14 rows=2,586,076 width=22) (actual time=0.038..681.497 rows=444,321 loops=1)

19. 590.521 590.521 ↑ 5.8 444,321 1

Seq Scan on yrk_callforservice c (cost=0.00..350,695.76 rows=2,586,076 width=22) (actual time=0.034..590.521 rows=444,321 loops=1)

20. 0.017 0.017 ↑ 1.0 1 1

Index Scan using stg_combined_incidents_wtrun_convertedid_idx on stg_combined_incidents sci (cost=0.43..0.50 rows=1 width=40) (actual time=0.017..0.017 rows=1 loops=1)

  • Index Cond: ((wtrun = 101) AND (convertedid = c.yrk_callforservice_zid))
Planning time : 44.776 ms
Execution time : 3,726.320 ms