explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LrRE : Optimization for: Optimization for: plan #Ysot; plan #HJWW

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.135 1,304.722 ↑ 263.4 600 1

Unique (cost=190,863.12..195,209.22 rows=158,040 width=162) (actual time=1,304.538..1,304.722 rows=600 loops=1)

2. 0.372 1,304.587 ↑ 263.4 600 1

Sort (cost=190,863.12..191,258.22 rows=158,040 width=162) (actual time=1,304.537..1,304.587 rows=600 loops=1)

  • Sort Key: u.id, u.username, f.name, p.name, b.balance, va.not_valid_after, va.not_valid_before, ((oo.delivery_destination ->> 'email'::text)), ((oo.delivery_destination ->> 'firstname'::text)), ((oo.delivery_destination ->> 'surname'::text))
  • Sort Method: quicksort Memory: 184kB
3. 24.262 1,304.215 ↑ 263.4 600 1

Hash Join (cost=115,354.67..164,248.92 rows=158,040 width=162) (actual time=897.189..1,304.215 rows=600 loops=1)

  • Hash Cond: (va.user_id = u.id)
4. 253.740 658.548 ↑ 194.5 1,112 1

Hash Join (cost=37,953.99..75,612.27 rows=216,248 width=74) (actual time=272.752..658.548 rows=1,112 loops=1)

  • Hash Cond: (b.id = va.balance_id)
5. 146.962 146.962 ↑ 1.0 1,095,691 1

Seq Scan on balances b (cost=0.00..17,938.40 rows=1,095,840 width=16) (actual time=0.011..146.962 rows=1,095,691 loops=1)

6. 0.704 257.846 ↑ 194.5 1,112 1

Hash (cost=32,504.89..32,504.89 rows=216,248 width=74) (actual time=257.846..257.846 rows=1,112 loops=1)

  • Buckets: 65,536 Batches: 8 Memory Usage: 531kB
7. 125.147 257.142 ↑ 194.5 1,112 1

Hash Join (cost=19.60..32,504.89 rows=216,248 width=74) (actual time=0.334..257.142 rows=1,112 loops=1)

  • Hash Cond: (va.program_id = p.id)
8. 131.787 131.787 ↑ 1.0 909,732 1

Seq Scan on virtual_accounts va (cost=0.00..26,911.32 rows=909,732 width=40) (actual time=0.109..131.787 rows=909,732 loops=1)

9. 0.009 0.208 ↑ 1.0 29 1

Hash (cost=19.24..19.24 rows=29 width=50) (actual time=0.208..0.208 rows=29 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
10. 0.019 0.199 ↑ 1.0 29 1

Hash Join (cost=12.31..19.24 rows=29 width=50) (actual time=0.155..0.199 rows=29 loops=1)

  • Hash Cond: (p.firm_id = f.id)
11. 0.040 0.040 ↑ 1.0 29 1

Seq Scan on programs p (cost=0.00..6.53 rows=29 width=35) (actual time=0.010..0.040 rows=29 loops=1)

  • Filter: (dict_program_type_id = 1,690)
  • Rows Removed by Filter: 93
12. 0.064 0.140 ↓ 1.0 326 1

Hash (cost=8.25..8.25 rows=325 width=31) (actual time=0.140..0.140 rows=326 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 30kB
13. 0.076 0.076 ↓ 1.0 326 1

Seq Scan on firms f (cost=0.00..8.25 rows=325 width=31) (actual time=0.007..0.076 rows=326 loops=1)

14. 52.578 621.405 ↓ 1.0 185,593 1

Hash (cost=72,182.87..72,182.87 rows=185,504 width=104) (actual time=621.405..621.405 rows=185,593 loops=1)

  • Buckets: 32,768 Batches: 8 Memory Usage: 2,684kB
15. 148.374 568.827 ↓ 1.0 185,593 1

Hash Join (cost=22,742.15..72,182.87 rows=185,504 width=104) (actual time=207.217..568.827 rows=185,593 loops=1)

  • Hash Cond: (oo.user_id = u.id)
16. 213.327 213.327 ↓ 1.0 185,593 1

Seq Scan on orders_offers oo (cost=0.00..39,222.04 rows=185,504 width=86) (actual time=0.018..213.327 rows=185,593 loops=1)

17. 88.572 207.126 ↑ 1.0 442,629 1

Hash (cost=14,615.29..14,615.29 rows=442,629 width=18) (actual time=207.126..207.126 rows=442,629 loops=1)

  • Buckets: 65,536 Batches: 8 Memory Usage: 3,272kB
18. 118.554 118.554 ↑ 1.0 442,629 1

Seq Scan on users u (cost=0.00..14,615.29 rows=442,629 width=18) (actual time=0.004..118.554 rows=442,629 loops=1)

Planning time : 1.585 ms
Execution time : 1,305.000 ms