explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YVFu

Settings
# exclusive inclusive rows x rows loops node
1. 0.015 1.496 ↑ 1.0 10 1

Limit (cost=47,373.21..47,373.23 rows=10 width=546) (actual time=1.481..1.496 rows=10 loops=1)

2. 0.150 1.481 ↑ 218,433.8 10 1

Sort (cost=47,373.21..52,834.05 rows=2,184,338 width=546) (actual time=1.477..1.481 rows=10 loops=1)

  • Sort Key: changes_y2018.change_date DESC
  • Sort Method: quicksort Memory: 30kB
3. 0.096 1.331 ↑ 218,433.8 10 1

Nested Loop (cost=1.55..170.45 rows=2,184,338 width=546) (actual time=0.642..1.331 rows=10 loops=1)

4. 0.046 0.345 ↑ 1.0 10 1

HashAggregate (cost=1.12..1.22 rows=10 width=4) (actual time=0.318..0.345 rows=10 loops=1)

  • Group Key: (unnest(patient_logs.change_ids))
5. 0.008 0.299 ↑ 1.0 10 1

Limit (cost=0.43..1.00 rows=10 width=8) (actual time=0.118..0.299 rows=10 loops=1)

6. 0.029 0.291 ↑ 1,480.0 10 1

ProjectSet (cost=0.43..843.31 rows=14,800 width=8) (actual time=0.117..0.291 rows=10 loops=1)

7. 0.262 0.262 ↑ 16.4 9 1

Index Scan Backward using patient_logs_patient_id_change_date_key on patient_logs (cost=0.43..768.20 rows=148 width=29) (actual time=0.111..0.262 rows=9 loops=1)

  • Index Cond: (patient_id = 386)
  • Filter: ('{surname,forename}'::text[] && fields)
8. 0.040 0.890 ↑ 2.0 1 10

Append (cost=0.43..16.90 rows=2 width=547) (actual time=0.087..0.089 rows=1 loops=10)

9. 0.210 0.210 ↓ 0.0 0 10

Index Scan using changes_y2018_change_id_change_date_idx on changes_y2018 (cost=0.43..8.45 rows=1 width=548) (actual time=0.021..0.021 rows=0 loops=10)

  • Index Cond: (change_id = (unnest(patient_logs.change_ids)))
10. 0.640 0.640 ↑ 1.0 1 10

Index Scan using changes_y2019_change_id_change_date_idx on changes_y2019 (cost=0.43..8.45 rows=1 width=546) (actual time=0.062..0.064 rows=1 loops=10)

  • Index Cond: (change_id = (unnest(patient_logs.change_ids)))