explain.depesz.com

PostgreSQL's explain analyze made readable

Result: I61d : TP Completed without end date

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 1,790.020 ↑ 1.0 1 1

Finalize Aggregate (cost=44,273.45..44,273.46 rows=1 width=8) (actual time=1,790.020..1,790.020 rows=1 loops=1)

2. 9.260 1,790.235 ↓ 1.5 3 1

Gather (cost=44,273.23..44,273.44 rows=2 width=8) (actual time=1,789.203..1,790.235 rows=3 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 34.770 1,780.975 ↑ 1.0 1 3 / 3

Partial Aggregate (cost=43,273.23..43,273.24 rows=1 width=8) (actual time=1,780.975..1,780.975 rows=1 loops=3)

4. 290.581 1,746.205 ↓ 1,297.2 49,294 3 / 3

Nested Loop (cost=1,351.94..43,273.14 rows=38 width=0) (actual time=17.870..1,746.205 rows=49,294 loops=3)

5. 206.420 213.616 ↓ 28.8 49,680 3 / 3

Parallel Bitmap Heap Scan on treatment_plans (cost=1,351.52..29,798.14 rows=1,724 width=16) (actual time=17.849..213.616 rows=49,680 loops=3)

  • Recheck Cond: (practice_id = 904)
  • Filter: completed
  • Rows Removed by Filter: 4032
  • Heap Blocks: exact=1124
6. 7.196 7.196 ↓ 19.5 161,137 1 / 3

Bitmap Index Scan on index_treatment_plans_on_practice_id_and_seq_id (cost=0.00..1,350.48 rows=8,274 width=0) (actual time=21.589..21.589 rows=161,137 loops=1)

  • Index Cond: (practice_id = 904)
7. 1,242.008 1,242.008 ↑ 1.0 1 149,041 / 3

Index Scan using index_patients_on_uuid on patients (cost=0.43..7.82 rows=1 width=16) (actual time=0.025..0.025 rows=1 loops=149,041)

  • Index Cond: (id = treatment_plans.patient_id)
  • Filter: (active AND (practice_id = 904))
  • Rows Removed by Filter: 0
Planning time : 0.347 ms
Execution time : 1,790.305 ms