explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4LHu

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 0.281 ↑ 1.0 10 1

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

2. 0.007 0.277 ↑ 200,796.2 10 1

Nested Loop (cost=1.43..170.31 rows=2,007,962 width=548) (actual time=0.106..0.277 rows=10 loops=1)

3. 0.009 0.070 ↑ 1.0 10 1

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

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

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

5. 0.009 0.058 ↑ 1,780.0 10 1

ProjectSet (cost=0.43..809.87 rows=17,800 width=8) (actual time=0.035..0.058 rows=10 loops=1)

6. 0.049 0.049 ↑ 17.8 10 1

Index Scan Backward using patient_logs_patient_id_change_date_key on patient_logs (cost=0.43..719.54 rows=178 width=29) (actual time=0.032..0.049 rows=10 loops=1)

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

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

8. 0.070 0.070 ↓ 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.007..0.007 rows=0 loops=10)

  • Index Cond: (change_id = (unnest(patient_logs.change_ids)))
9. 0.110 0.110 ↑ 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.011..0.011 rows=1 loops=10)

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