explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Fjb4

Settings
# exclusive inclusive rows x rows loops node
1. 3.276 4,015.347 ↑ 1.0 1 1

Aggregate (cost=58,900.63..58,900.64 rows=1 width=4) (actual time=4,015.347..4,015.347 rows=1 loops=1)

2. 16.589 4,012.071 ↓ 25.3 32,006 1

Nested Loop (cost=10,480.66..58,897.47 rows=1,264 width=4) (actual time=2,447.479..4,012.071 rows=32,006 loops=1)

3. 7.239 2,459.098 ↓ 2.6 32,008 1

Merge Left Join (cost=10,480.23..10,636.02 rows=12,117 width=4) (actual time=2,447.380..2,459.098 rows=32,008 loops=1)

  • Merge Cond: (((pd.doc_format)::text = dat.doc_format) AND (pd.template_id = dat.template_id))
  • Filter: ((NOT dat.specialized) OR (pd.template_id IS NULL))
4. 35.394 2,451.859 ↓ 1.6 32,008 1

Sort (cost=10,430.47..10,481.15 rows=20,272 width=34) (actual time=2,447.373..2,451.859 rows=32,008 loops=1)

  • Sort Key: pd.doc_format, pd.template_id
  • Sort Method: quicksort Memory: 3269kB
5. 2,416.465 2,416.465 ↓ 1.6 32,008 1

Index Scan using idx_center_id on patient_documents pd (cost=0.44..8,980.29 rows=20,272 width=34) (actual time=5.437..2,416.465 rows=32,008 loops=1)

  • Index Cond: (center_id = 5)
6. 0.000 0.000 ↓ 0.0 0

Sort (cost=49.76..50.57 rows=324 width=37) (never executed)

  • Sort Key: dat.doc_format, dat.template_id
7. 0.000 0.000 ↓ 0.0 0

Subquery Scan on dat (cost=29.77..36.25 rows=324 width=37) (never executed)

8. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=29.77..33.01 rows=324 width=207) (never executed)

9. 0.000 0.000 ↓ 0.0 0

Append (cost=0.00..22.48 rows=324 width=207) (never executed)

10. 0.000 0.000 ↓ 0.0 0

Seq Scan on doc_hvf_templates (cost=0.00..1.01 rows=1 width=73) (never executed)

11. 0.000 0.000 ↓ 0.0 0

Seq Scan on doc_rich_templates (cost=0.00..2.17 rows=17 width=68) (never executed)

12. 0.000 0.000 ↓ 0.0 0

Seq Scan on doc_pdf_form_templates (cost=0.00..4.16 rows=116 width=44) (never executed)

13. 0.000 0.000 ↓ 0.0 0

Seq Scan on doc_rtf_templates (cost=0.00..11.90 rows=190 width=319) (never executed)

14. 1,536.384 1,536.384 ↑ 1.0 1 32,008

Index Scan using patient_general_docs_pkey on patient_general_docs pgd (cost=0.43..3.97 rows=1 width=6) (actual time=0.048..0.048 rows=1 loops=32,008)

  • Index Cond: (doc_id = pd.doc_id)