explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 0C4q

Settings
# exclusive inclusive rows x rows loops node
1. 0.021 105,016.830 ↑ 1.0 20 1

Limit (cost=1.43..1,726,978.87 rows=20 width=158) (actual time=96,687.623..105,016.830 rows=20 loops=1)

2. 0.126 105,016.809 ↑ 39.8 20 1

Nested Loop (cost=1.43..68,647,354.79 rows=795 width=158) (actual time=96,687.620..105,016.809 rows=20 loops=1)

3. 2,285.925 104,986.883 ↑ 39.8 20 1

Nested Loop (cost=1.00..68,644,306.58 rows=795 width=147) (actual time=96,685.643..104,986.883 rows=20 loops=1)

  • Join Filter: (grants.id = gtov."grantId")
  • Rows Removed by Join Filter: 41,609,174
4. 0.110 3.418 ↑ 2,145.8 20 1

Nested Loop (cost=0.43..304,322.26 rows=42,915 width=107) (actual time=0.943..3.418 rows=20 loops=1)

  • Join Filter: (grants."benefitId" = benefits.id)
  • Rows Removed by Join Filter: 593
5. 3.180 3.180 ↑ 37,550.7 64 1

Index Scan Backward using grants_pkey on grants (cost=0.43..268,268.92 rows=2,403,242 width=42) (actual time=0.856..3.180 rows=64 loops=1)

6. 0.038 0.128 ↓ 10.0 10 64

Materialize (cost=0.00..4.71 rows=1 width=69) (actual time=0.001..0.002 rows=10 loops=64)

7. 0.090 0.090 ↓ 12.0 12 1

Seq Scan on benefits (cost=0.00..4.70 rows=1 width=69) (actual time=0.043..0.090 rows=12 loops=1)

  • Filter: (target = 'benefits'::text)
  • Rows Removed by Filter: 38
8. 7,175.551 102,697.540 ↓ 46.7 2,080,460 20

Materialize (cost=0.57..39,692,401.91 rows=44,503 width=44) (actual time=0.124..5,134.877 rows=2,080,460 loops=20)

9. 192.457 95,521.989 ↓ 46.7 2,080,481 1

Subquery Scan on gtov (cost=0.57..39,692,179.40 rows=44,503 width=44) (actual time=1.870..95,521.989 rows=2,080,481 loops=1)

10. 77,802.235 95,329.532 ↓ 46.7 2,080,481 1

GroupAggregate (cost=0.57..39,691,734.37 rows=44,503 width=44) (actual time=1.868..95,329.532 rows=2,080,481 loops=1)

  • Group Key: "grantToVehicle"."grantId
11. 17,527.297 17,527.297 ↓ 1.0 73,686,509 1

Index Scan using "grantToVehicle_grantId" on "grantToVehicle" (cost=0.57..2,488,417.26 rows=73,668,613 width=17) (actual time=1.393..17,527.297 rows=73,686,509 loops=1)

12. 29.800 29.800 ↑ 1.0 1 20

Index Scan using vehicles_pkey on vehicles (cost=0.43..3.83 rows=1 width=19) (actual time=1.490..1.490 rows=1 loops=20)

  • Index Cond: (id = gtov."vehicleId")