explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ZmyQ

Settings
# exclusive inclusive rows x rows loops node
1. 0.011 0.559 ↑ 1.0 10 1

Limit (cost=1.43..1.44 rows=10 width=548) (actual time=0.138..0.559 rows=10 loops=1)

2. 0.013 0.548 ↑ 211,972.6 10 1

Nested Loop (cost=1.43..170.33 rows=2,119,726 width=548) (actual time=0.137..0.548 rows=10 loops=1)

3. 0.017 0.075 ↑ 1.0 10 1

HashAggregate (cost=1.01..1.11 rows=10 width=4) (actual time=0.064..0.075 rows=10 loops=1)

  • Group Key: (unnest(patient_logs.change_ids))
4. 0.003 0.058 ↑ 1.0 10 1

Limit (cost=0.43..0.88 rows=10 width=8) (actual time=0.041..0.058 rows=10 loops=1)

5. 0.009 0.055 ↑ 1,870.0 10 1

ProjectSet (cost=0.43..850.59 rows=18,700 width=8) (actual time=0.041..0.055 rows=10 loops=1)

6. 0.046 0.046 ↑ 20.8 9 1

Index Scan Backward using patient_logs_patient_id_change_date_key on patient_logs (cost=0.43..755.69 rows=187 width=29) (actual time=0.037..0.046 rows=9 loops=1)

  • Index Cond: (patient_id = 386)
7. 0.020 0.460 ↑ 2.0 1 10

Append (cost=0.43..16.90 rows=2 width=548) (actual time=0.045..0.046 rows=1 loops=10)

8. 0.110 0.110 ↓ 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.011..0.011 rows=0 loops=10)

  • Index Cond: (change_id = (unnest(patient_logs.change_ids)))
9. 0.330 0.330 ↑ 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=548) (actual time=0.032..0.033 rows=1 loops=10)

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