explain.depesz.com

PostgreSQL's explain analyze made readable

Result: x4NZ

Settings
# exclusive inclusive rows x rows loops node
1. 1,005.192 5,028.484 ↑ 1.0 872,453 1

Finalize GroupAggregate (cost=328,366.73..454,797.61 rows=877,359 width=72) (actual time=2,742.112..5,028.484 rows=872,453 loops=1)

  • Group Key: br.id, (btrim(((((COALESCE(g.surname, ''''::text) || ' '::text) || COALESCE(g.name, ''''::text)) || ' '::text) || COALESCE(g.patronymic, ' '::text))))
2. 511.253 4,023.292 ↓ 1.2 872,681 1

Gather Merge (cost=328,366.73..425,552.31 rows=731,132 width=72) (actual time=2,742.081..4,023.292 rows=872,681 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 538.888 3,512.039 ↑ 1.3 290,894 3 / 3

Partial GroupAggregate (cost=327,366.71..340,161.52 rows=365,566 width=72) (actual time=2,719.229..3,512.039 rows=290,894 loops=3)

  • Group Key: br.id, (btrim(((((COALESCE(g.surname, ''''::text) || ' '::text) || COALESCE(g.name, ''''::text)) || ' '::text) || COALESCE(g.patronymic, ' '::text))))
4. 557.767 2,973.151 ↑ 1.3 290,931 3 / 3

Sort (cost=327,366.71..328,280.62 rows=365,566 width=72) (actual time=2,719.180..2,973.151 rows=290,931 loops=3)

  • Sort Key: br.id, (btrim(((((COALESCE(g.surname, ''''::text) || ' '::text) || COALESCE(g.name, ''''::text)) || ' '::text) || COALESCE(g.patronymic, ' '::text))))
  • Sort Method: external merge Disk: 21,560kB
  • Worker 0: Sort Method: external merge Disk: 20,160kB
  • Worker 1: Sort Method: external merge Disk: 18,008kB
5. 653.028 2,415.384 ↑ 1.3 290,931 3 / 3

Parallel Hash Left Join (cost=196,721.95..278,594.82 rows=365,566 width=72) (actual time=1,866.988..2,415.384 rows=290,931 loops=3)

  • Hash Cond: (brg.guest_id = g.id)
6. 272.854 974.593 ↑ 1.3 290,931 3 / 3

Parallel Hash Join (cost=88,145.09..153,127.78 rows=365,566 width=48) (actual time=806.044..974.593 rows=290,931 loops=3)

  • Hash Cond: (brg.booked_room_id = br.id)
7. 297.041 297.041 ↑ 1.3 291,109 3 / 3

Parallel Seq Scan on booked_room_guest brg (cost=0.00..58,647.07 rows=365,566 width=16) (actual time=0.035..297.041 rows=291,109 loops=3)

  • Filter: (actual_arrival_time IS NOT NULL)
  • Rows Removed by Filter: 109,301
8. 68.241 404.698 ↑ 1.3 184,114 3 / 3

Parallel Hash (cost=83,450.15..83,450.15 rows=231,115 width=40) (actual time=404.697..404.698 rows=184,114 loops=3)

  • Buckets: 131,072 Batches: 8 Memory Usage: 3,776kB
9. 336.457 336.457 ↑ 1.3 184,114 3 / 3

Parallel Seq Scan on booked_room br (cost=0.00..83,450.15 rows=231,115 width=40) (actual time=0.028..336.457 rows=184,114 loops=3)

10. 212.546 787.763 ↑ 1.2 369,772 3 / 3

Parallel Hash (cost=97,900.27..97,900.27 rows=459,327 width=59) (actual time=787.763..787.763 rows=369,772 loops=3)

  • Buckets: 131,072 Batches: 16 Memory Usage: 7,552kB
11. 575.217 575.217 ↑ 1.2 369,772 3 / 3

Parallel Seq Scan on guest g (cost=0.00..97,900.27 rows=459,327 width=59) (actual time=0.100..575.217 rows=369,772 loops=3)

Planning time : 1.178 ms
Execution time : 5,242.791 ms