explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NJRf : Optimization for: plan #x72U

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 50.271 402.819 ↑ 1.0 131 1

Unique (cost=10,554.43..10,599.34 rows=135 width=1,568) (actual time=297.131..402.819 rows=131 loops=1)

2. 125.257 352.548 ↓ 1.0 9,242 1

Sort (cost=10,554.43..10,576.88 rows=8,983 width=1,568) (actual time=297.120..352.548 rows=9,242 loops=1)

  • Sort Key: cases_result.test_id, cases_result.created_at DESC
  • Sort Method: external merge Disk: 9600kB
3. 84.592 227.291 ↓ 1.0 9,242 1

Hash Join (cost=12.78..3,853.56 rows=8,983 width=1,568) (actual time=2.328..227.291 rows=9,242 loops=1)

  • Hash Cond: (cases_result.test_id = cases_test.id)
4. 86.284 141.543 ↓ 1.0 9,242 1

Hash Join (cost=6.56..3,823.06 rows=8,983 width=1,052) (actual time=1.154..141.543 rows=9,242 loops=1)

  • Hash Cond: (cases_result.test_id = u0.id)
5. 54.130 54.130 ↓ 1.0 9,358 1

Seq Scan on cases_result (cost=0.00..3,792.05 rows=9,046 width=1,048) (actual time=0.008..54.130 rows=9,358 loops=1)

  • Filter: (environment_id = 1001)
  • Rows Removed by Filter: 15934
6. 0.551 1.129 ↑ 1.0 142 1

Hash (cost=4.79..4.79 rows=142 width=4) (actual time=1.126..1.129 rows=142 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
7. 0.578 0.578 ↑ 1.0 142 1

Seq Scan on cases_test u0 (cost=0.00..4.79 rows=142 width=4) (actual time=0.009..0.578 rows=142 loops=1)

  • Filter: ((name)::text !~~ 'sample%'::text)
  • Rows Removed by Filter: 1
8. 0.571 1.156 ↑ 1.0 143 1

Hash (cost=4.43..4.43 rows=143 width=520) (actual time=1.152..1.156 rows=143 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 28kB
9. 0.585 0.585 ↑ 1.0 143 1

Seq Scan on cases_test (cost=0.00..4.43 rows=143 width=520) (actual time=0.010..0.585 rows=143 loops=1)

Planning time : 1.095 ms
Execution time : 406.012 ms