explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Ysot

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.291 1,183.487 ↑ 97.7 1,132 1

Unique (cost=169,728.06..172,768.65 rows=110,567 width=162) (actual time=1,183.089..1,183.487 rows=1,132 loops=1)

2. 0.911 1,183.196 ↑ 97.7 1,132 1

Sort (cost=169,728.06..170,004.48 rows=110,567 width=162) (actual time=1,183.088..1,183.196 rows=1,132 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: 342kB
3. 0.639 1,182.285 ↑ 97.7 1,132 1

Hash Left Join (cost=102,292.94..151,393.55 rows=110,567 width=162) (actual time=911.830..1,182.285 rows=1,132 loops=1)

  • Hash Cond: (p.firm_id = f.id)
4. 60.944 1,181.541 ↑ 97.7 1,132 1

Hash Right Join (cost=102,280.63..149,031.69 rows=110,567 width=147) (actual time=911.702..1,181.541 rows=1,132 loops=1)

  • Hash Cond: (oo.user_id = u.id)
5. 218.675 218.675 ↓ 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.026..218.675 rows=185,593 loops=1)

6. 0.548 901.922 ↑ 99.6 1,110 1

Hash (cost=99,602.54..99,602.54 rows=110,567 width=69) (actual time=901.922..901.922 rows=1,110 loops=1)

  • Buckets: 65,536 Batches: 4 Memory Usage: 553kB
7. 38.661 901.374 ↑ 99.6 1,110 1

Hash Join (cost=57,722.69..99,602.54 rows=110,567 width=69) (actual time=495.235..901.374 rows=1,110 loops=1)

  • Hash Cond: (va.user_id = u.id)
8. 233.718 642.215 ↑ 106.2 1,112 1

Hash Right Join (cost=34,980.54..70,179.98 rows=118,064 width=59) (actual time=264.012..642.215 rows=1,112 loops=1)

  • Hash Cond: (b.id = va.balance_id)
9. 151.549 151.549 ↑ 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.005..151.549 rows=1,095,691 loops=1)

10. 0.540 256.948 ↑ 106.2 1,112 1

Hash (cost=32,235.74..32,235.74 rows=118,064 width=59) (actual time=256.948..256.948 rows=1,112 loops=1)

  • Buckets: 65,536 Batches: 4 Memory Usage: 544kB
11. 34.189 256.408 ↑ 106.2 1,112 1

Hash Join (cost=6.89..32,235.74 rows=118,064 width=59) (actual time=0.164..256.408 rows=1,112 loops=1)

  • Hash Cond: (va.program_id = p.id)
12. 222.177 222.177 ↑ 1.0 494,324 1

Seq Scan on virtual_accounts va (cost=0.00..29,185.65 rows=496,683 width=40) (actual time=0.100..222.177 rows=494,324 loops=1)

  • Filter: (program_id <> '-1'::integer)
  • Rows Removed by Filter: 415,408
13. 0.005 0.042 ↑ 1.0 29 1

Hash (cost=6.53..6.53 rows=29 width=35) (actual time=0.042..0.042 rows=29 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
14. 0.037 0.037 ↑ 1.0 29 1

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

  • Filter: (dict_program_type_id = 1,690)
  • Rows Removed by Filter: 93
15. 95.004 220.498 ↑ 1.0 442,629 1

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

  • Buckets: 65,536 Batches: 8 Memory Usage: 3,261kB
16. 125.494 125.494 ↑ 1.0 442,629 1

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

17. 0.047 0.105 ↓ 1.0 326 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 30kB
18. 0.058 0.058 ↓ 1.0 326 1

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

Planning time : 2.456 ms
Execution time : 1,184.014 ms