explain.depesz.com

PostgreSQL's explain analyze made readable

Result: sDR24

Settings
# exclusive inclusive rows x rows loops node
1. 0.110 9,438.914 ↑ 1.0 1,000 1

Limit (cost=640,167.65..640,272.65 rows=1,000 width=6) (actual time=9,438.109..9,438.914 rows=1,000 loops=1)

2. 0.180 9,438.804 ↑ 95.7 1,000 1

Subquery Scan on t (cost=640,167.65..650,213.60 rows=95,676 width=6) (actual time=9,438.107..9,438.804 rows=1,000 loops=1)

  • Filter: (t.rnum > 1)
  • Rows Removed by Filter: 142
3. 0.523 9,438.624 ↑ 251.3 1,142 1

WindowAgg (cost=640,167.65..646,625.76 rows=287,027 width=26) (actual time=9,438.081..9,438.624 rows=1,142 loops=1)

4. 192.769 9,438.101 ↑ 251.3 1,142 1

Sort (cost=640,167.65..640,885.22 rows=287,027 width=18) (actual time=9,437.954..9,438.101 rows=1,142 loops=1)

  • Sort Key: mrd.merge_request_id, deployments.environment_id, deployments.id
  • Sort Method: quicksort Memory: 18449kB
5. 2,107.025 9,245.332 ↑ 1.8 157,492 1

Hash Join (cost=38,412.19..614,147.47 rows=287,027 width=18) (actual time=2,632.757..9,245.332 rows=157,492 loops=1)

  • Hash Cond: (mrd.deployment_id = deployments.id)
6. 4,510.841 4,510.841 ↓ 1.0 18,023,725 1

Seq Scan on deployment_merge_requests mrd (cost=0.00..505,575.28 rows=17,943,928 width=14) (actual time=0.046..4,510.841 rows=18,023,725 loops=1)

7. 290.672 2,627.466 ↓ 1.0 897,370 1

Hash (cost=27,339.30..27,339.30 rows=885,831 width=8) (actual time=2,627.465..2,627.466 rows=897,370 loops=1)

  • Buckets: 1048576 Batches: 1 Memory Usage: 43246kB
8. 2,336.794 2,336.794 ↓ 1.0 897,370 1

Index Only Scan using index_deployments_on_environment_id_and_id on deployments (cost=0.56..27,339.30 rows=885,831 width=8) (actual time=1.057..2,336.794 rows=897,370 loops=1)

  • Index Cond: ((environment_id >= 10000) AND (environment_id <= 20000))
  • Heap Fetches: 16405
Planning time : 4.039 ms
Execution time : 9,442.503 ms