explain.depesz.com

PostgreSQL's explain analyze made readable

Result: m4je

Settings
# exclusive inclusive rows x rows loops node
1. 1,119.179 7,449.191 ↑ 1.0 1,200,689 1

Hash Left Join (cost=226,981.53..369,734.56 rows=1,204,336 width=140) (actual time=2,976.933..7,449.191 rows=1,200,689 loops=1)

  • Hash Cond: (brg.room_id = r.id)
2. 363.342 6,327.476 ↑ 1.0 1,200,689 1

Hash Left Join (cost=226,863.40..351,400.83 rows=1,204,336 width=135) (actual time=2,974.353..6,327.476 rows=1,200,689 loops=1)

  • Hash Cond: (br.contract_id = ct.id)
3. 1,288.656 5,963.502 ↑ 1.0 1,200,689 1

Hash Left Join (cost=226,823.90..346,845.05 rows=1,204,336 width=79) (actual time=2,973.673..5,963.502 rows=1,200,689 loops=1)

  • Hash Cond: (brg.guest_id = g.id)
4. 931.484 2,832.651 ↑ 1.0 1,200,689 1

Hash Right Join (cost=96,870.23..183,069.00 rows=1,204,336 width=36) (actual time=1,131.016..2,832.651 rows=1,200,689 loops=1)

  • Hash Cond: (brg.booked_room_id = br.id)
5. 770.624 770.624 ↑ 1.0 1,201,230 1

Seq Scan on booked_room_guest brg (cost=0.00..65,672.36 rows=1,204,336 width=24) (actual time=0.016..770.624 rows=1,201,230 loops=1)

6. 213.801 1,130.543 ↑ 1.0 552,341 1

Hash (cost=86,685.77..86,685.77 rows=554,677 width=20) (actual time=1,130.542..1,130.543 rows=552,341 loops=1)

  • Buckets: 131,072 Batches: 8 Memory Usage: 3,715kB
7. 916.742 916.742 ↑ 1.0 552,341 1

Seq Scan on booked_room br (cost=0.00..86,685.77 rows=554,677 width=20) (actual time=0.023..916.742 rows=552,341 loops=1)

8. 465.778 1,842.195 ↓ 1.0 1,109,316 1

Hash (cost=104,330.85..104,330.85 rows=1,102,385 width=59) (actual time=1,842.195..1,842.195 rows=1,109,316 loops=1)

  • Buckets: 131,072 Batches: 16 Memory Usage: 7,395kB
9. 1,376.417 1,376.417 ↓ 1.0 1,109,316 1

Seq Scan on guest g (cost=0.00..104,330.85 rows=1,102,385 width=59) (actual time=0.037..1,376.417 rows=1,109,316 loops=1)

10. 0.011 0.632 ↑ 20.9 11 1

Hash (cost=36.63..36.63 rows=230 width=72) (actual time=0.631..0.632 rows=11 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
11. 0.037 0.621 ↑ 20.9 11 1

Hash Left Join (cost=23.73..36.63 rows=230 width=72) (actual time=0.612..0.621 rows=11 loops=1)

  • Hash Cond: (ct.company_id = cp.id)
12. 0.023 0.023 ↑ 20.9 11 1

Seq Scan on contract ct (cost=0.00..12.30 rows=230 width=48) (actual time=0.019..0.023 rows=11 loops=1)

13. 0.195 0.561 ↓ 1.0 623 1

Hash (cost=16.10..16.10 rows=610 width=40) (actual time=0.560..0.561 rows=623 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 54kB
14. 0.366 0.366 ↓ 1.0 623 1

Seq Scan on company cp (cost=0.00..16.10 rows=610 width=40) (actual time=0.018..0.366 rows=623 loops=1)

15. 0.755 2.536 ↑ 1.0 2,902 1

Hash (cost=81.39..81.39 rows=2,939 width=40) (actual time=2.536..2.536 rows=2,902 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 169kB
16. 1.781 1.781 ↑ 1.0 2,902 1

Seq Scan on room r (cost=0.00..81.39 rows=2,939 width=40) (actual time=0.018..1.781 rows=2,902 loops=1)

Planning time : 2.186 ms
Execution time : 7,555.652 ms