explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4BVx

Settings
# exclusive inclusive rows x rows loops node
1. 1.884 184.049 ↓ 1,573.0 1,573 1

Sort (cost=5.03..5.04 rows=1 width=537) (actual time=183.878..184.049 rows=1,573 loops=1)

  • Sort Key: appointments.created_at DESC
  • Sort Method: quicksort Memory: 466kB
2. 0.431 182.165 ↓ 1,573.0 1,573 1

Nested Loop (cost=1.22..5.02 rows=1 width=537) (actual time=83.551..182.165 rows=1,573 loops=1)

3. 1.221 154.054 ↓ 1,730.0 1,730 1

Nested Loop (cost=0.80..4.32 rows=1 width=541) (actual time=83.508..154.054 rows=1,730 loops=1)

4. 121.693 121.693 ↓ 1,730.0 1,730 1

Index Scan using appointments_updated_at_idx on appointments (cost=0.38..1.68 rows=1 width=537) (actual time=83.456..121.693 rows=1,730 loops=1)

  • Filter: ((source)::text = 'patient'::text)
  • Rows Removed by Filter: 1,328
5. 31.140 31.140 ↑ 1.0 1 1,730

Index Scan using agendas_pkey on agendas (cost=0.42..2.64 rows=1 width=8) (actual time=0.018..0.018 rows=1 loops=1,730)

  • Index Cond: (id = appointments.agenda_id)
6. 27.680 27.680 ↑ 1.0 1 1,730

Index Scan using organizations_pkey on organizations (cost=0.42..0.71 rows=1 width=4) (actual time=0.016..0.016 rows=1 loops=1,730)

  • Index Cond: (id = agendas.organization_id)
  • Filter: ((country)::text = 'fr'::text)
  • Rows Removed by Filter: 0
Planning time : 16.679 ms
Execution time : 184.281 ms