explain.depesz.com

PostgreSQL's explain analyze made readable

Result: a2v8

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

Limit (cost=46,063.07..46,063.10 rows=10 width=548) (actual time=0.412..0.416 rows=10 loops=1)

2. 0.013 0.412 ↑ 212,371.6 10 1

Sort (cost=46,063.07..51,372.36 rows=2,123,716 width=548) (actual time=0.411..0.412 rows=10 loops=1)

  • Sort Key: changes_y2018.change_date DESC
  • Sort Method: quicksort Memory: 30kB
3. 0.010 0.399 ↑ 212,371.6 10 1

Nested Loop (cost=1.43..170.33 rows=2,123,716 width=548) (actual time=0.179..0.399 rows=10 loops=1)

4. 0.013 0.109 ↑ 1.0 10 1

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

  • Group Key: (unnest(patient_logs.change_ids))
5. 0.003 0.096 ↑ 1.0 10 1

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

6. 0.013 0.093 ↑ 1,870.0 10 1

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

7. 0.080 0.080 ↑ 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.047..0.080 rows=9 loops=1)

  • Index Cond: (patient_id = 386)
8. 0.020 0.280 ↑ 2.0 1 10

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

9. 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)))
10. 0.190 0.190 ↑ 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.019..0.019 rows=1 loops=10)

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