explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6skY

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

Limit (cost=46,246.71..46,246.74 rows=10 width=548) (actual time=0.306..0.310 rows=10 loops=1)

2. 0.012 0.306 ↑ 213,221.4 10 1

Sort (cost=46,246.71..51,577.25 rows=2,132,214 width=548) (actual time=0.305..0.306 rows=10 loops=1)

  • Sort Key: changes_y2018.change_date DESC
  • Sort Method: quicksort Memory: 30kB
3. 0.005 0.294 ↑ 213,221.4 10 1

Nested Loop (cost=1.43..170.33 rows=2,132,214 width=548) (actual time=0.129..0.294 rows=10 loops=1)

4. 0.009 0.079 ↑ 1.0 10 1

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

  • Group Key: (unnest(patient_logs.change_ids))
5. 0.002 0.070 ↑ 1.0 10 1

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

6. 0.009 0.068 ↑ 1,880.0 10 1

ProjectSet (cost=0.43..855.12 rows=18,800 width=8) (actual time=0.027..0.068 rows=10 loops=1)

7. 0.059 0.059 ↑ 20.9 9 1

Index Scan Backward using patient_logs_patient_id_change_date_key on patient_logs (cost=0.43..759.71 rows=188 width=29) (actual time=0.024..0.059 rows=9 loops=1)

  • Index Cond: (patient_id = 386)
8. 0.010 0.210 ↑ 2.0 1 10

Append (cost=0.43..16.90 rows=2 width=548) (actual time=0.020..0.021 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.130 0.130 ↑ 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.013..0.013 rows=1 loops=10)

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