explain.depesz.com

PostgreSQL's explain analyze made readable

Result: EIjD

Settings
# exclusive inclusive rows x rows loops node
1. 2.826 23.468 ↑ 1.0 195 1

GroupAggregate (cost=1,956.22..2,113.48 rows=195 width=64) (actual time=20.520..23.468 rows=195 loops=1)

  • Group Key: o.order_id
2. 0.197 20.642 ↓ 1.0 208 1

Merge Join (cost=1,956.22..1,960.25 rows=207 width=133) (actual time=20.403..20.642 rows=208 loops=1)

  • Merge Cond: (o.order_id = vt.order_id)
3. 0.183 0.365 ↑ 1.0 195 1

Sort (cost=16.37..16.85 rows=195 width=61) (actual time=0.340..0.365 rows=195 loops=1)

  • Sort Key: o.order_id
  • Sort Method: quicksort Memory: 35kB
4. 0.182 0.182 ↑ 1.0 195 1

Seq Scan on orders o (cost=0.00..8.95 rows=195 width=61) (actual time=0.023..0.182 rows=195 loops=1)

5. 0.131 20.080 ↓ 1.0 208 1

Sort (cost=1,939.85..1,940.37 rows=207 width=80) (actual time=20.056..20.080 rows=208 loops=1)

  • Sort Key: vt.order_id
  • Sort Method: quicksort Memory: 34kB
6. 0.068 19.949 ↓ 1.0 208 1

Subquery Scan on vt (cost=1,929.30..1,931.89 rows=207 width=80) (actual time=19.859..19.949 rows=208 loops=1)

7. 0.329 19.881 ↓ 1.0 208 1

Sort (cost=1,929.30..1,929.82 rows=207 width=324) (actual time=19.857..19.881 rows=208 loops=1)

  • Sort Key: t.created_at DESC
  • Sort Method: quicksort Memory: 41kB
8. 0.624 19.552 ↓ 1.0 208 1

Seq Scan on tasks t (cost=0.00..1,921.34 rows=207 width=324) (actual time=0.169..19.552 rows=208 loops=1)

9.          

SubPlan (forSeq Scan)

10. 0.832 9.360 ↑ 1.0 1 208

Aggregate (cost=4.61..4.62 rows=1 width=32) (actual time=0.045..0.045 rows=1 loops=208)

11. 8.528 8.528 ↑ 2.0 1 208

Seq Scan on task_source_files (cost=0.00..4.60 rows=2 width=8) (actual time=0.031..0.041 rows=1 loops=208)

  • Filter: (task_id = t.task_id)
  • Rows Removed by Filter: 161
12. 9.568 9.568 ↑ 1.0 1 208

Aggregate (cost=4.61..4.62 rows=1 width=32) (actual time=0.045..0.046 rows=1 loops=208)

  • -> Seq Scan on task_source_files task_source_files_1 (cost=0.00..4.60 rows=2 width=8) (actual time=0.031..0.042 rows=1 loops=20
  • Filter: (task_id = t.task_id)
  • Rows Removed by Filter: 161