explain.depesz.com

PostgreSQL's explain analyze made readable

Result: IIUk

Settings
# exclusive inclusive rows x rows loops node
1. 0.158 23,749.590 ↑ 17.1 353 1

Unique (cost=523,619.99..523,695.36 rows=6,030 width=24) (actual time=23,749.397..23,749.59 rows=353 loops=1)

  • Buffers: shared hit=9715 read=46660 written=779
2. 0.244 23,749.432 ↑ 17.1 353 1

Sort (cost=523,619.99..523,635.06 rows=6,030 width=24) (actual time=23,749.389..23,749.432 rows=353 loops=1)

  • Sort Key: p_2.id, p_2.tipo, (min(g.id)), (min(s.last_synch))
  • Sort Method: quicksort Memory: 52kB
  • Buffers: shared hit=9715 read=46660 written=779
3. 0.000 23,749.188 ↑ 17.1 353 1

Aggregate (cost=519,309.06..523,241.36 rows=6,030 width=24) (actual time=23,748.089..23,749.188 rows=353 loops=1)

  • Buffers: shared hit=9715 read=46660 written=779
4. 354.884 23,970.694 ↑ 22.9 1,317 1

Gather Merge (cost=519,309.06..522,954.94 rows=30,150 width=24) (actual time=23,747.998..23,970.694 rows=1,317 loops=1)

  • Workers Planned: 5
  • Workers Launched: 5
  • Buffers: shared hit=64814 read=271280 written=4394
5. 0.298 23,615.810 ↑ 27.4 220 6 / 6

Sort (cost=518,308.98..518,324.05 rows=6,030 width=24) (actual time=23,615.772..23,615.81 rows=220 loops=6)

  • Sort Key: p_2.id
  • Sort Method: quicksort Memory: 42kB
  • Buffers: shared hit=64814 read=271280 written=4394
6. 64.803 23,615.512 ↑ 27.4 220 6 / 6

Aggregate (cost=517,870.06..517,930.36 rows=6,030 width=24) (actual time=23,615.179..23,615.512 rows=220 loops=6)

  • Buffers: shared hit=64774 read=271280 written=4394
7. 95.989 23,550.709 ↑ 4.2 140,585 6 / 6

Hash Join (cost=5,333.51..513,403.57 rows=595,531 width=24) (actual time=1,681.233..23,550.709 rows=140,585 loops=6)

  • Buffers: shared hit=64774 read=271280 written=4394
8. 21,798.397 21,798.397 ↑ 6.1 140,585 6 / 6

Index Scan using new_logs_running_frozen_btree on new_logs_running g (cost=0.43..501,342.3 rows=860,013 width=12) (actual time=22.757..21,798.397 rows=140,585 loops=6)

  • Filter: ((g.day >= CURRENT_DATE) AND (g.scheduled_date <= CURRENT_DATE))
  • Buffers: shared hit=61444 read=271280 written=4394
9. 349.373 1,656.323 ↑ 3.5 17,991 6 / 6

Hash (cost=4,555.03..4,555.03 rows=62,244 width=20) (actual time=1,656.322..1,656.323 rows=17,991 loops=6)

  • Buffers: shared hit=3330
10. 5.848 1,306.950 ↑ 3.5 17,991 6 / 6

Hash Join (cost=566.66..4,555.03 rows=62,244 width=20) (actual time=1,278.38..1,306.95 rows=17,991 loops=6)

  • Buffers: shared hit=3330
11. 4.825 1,298.308 ↑ 3.5 17,991 6 / 6

Hash Join (cost=341.05..4,165.94 rows=62,244 width=12) (actual time=1,275.567..1,298.308 rows=17,991 loops=6)

  • Buffers: shared hit=3120
12. 7.747 20.108 ↑ 3.5 17,991 6 / 6

Hash Join (cost=330.28..3,989.53 rows=62,244 width=12) (actual time=2.088..20.108 rows=17,991 loops=6)

  • Buffers: shared hit=3103
13. 10.312 10.312 ↑ 3.5 21,579 6 / 6

Seq Scan on rooms r (cost=0..3,458.86 rows=76,292 width=8) (actual time=0.02..10.312 rows=21,579 loops=6)

  • Filter: r.attiva
  • Buffers: shared hit=2560
14. 0.684 2.049 ↑ 1.0 5,963 3 / 6

Hash (cost=254.91..254.91 rows=6,030 width=8) (actual time=4.097..4.098 rows=5,963 loops=3)

  • Buffers: shared hit=543
15. 1.365 1.365 ↑ 1.0 5,963 3 / 6

Seq Scan on portals p_2 (cost=0..254.91 rows=6,030 width=8) (actual time=0.045..2.729 rows=5,963 loops=3)

  • Filter: p_2.enabled
  • Buffers: shared hit=543
16. 1,273.184 1,273.375 ↑ 1.0 305 6 / 6

Hash (cost=6.94..6.94 rows=306 width=4) (actual time=1,273.374..1,273.375 rows=305 loops=6)

  • Buffers: shared hit=17
17. 0.191 0.191 ↑ 1.0 305 6 / 6

Index Only Scan using portal_types_pkey on portal_types t_1 (cost=0.15..6.94 rows=306 width=4) (actual time=0.146..0.191 rows=305 loops=6)

  • Buffers: shared hit=17
18. 0.934 2.794 ↑ 1.0 6,916 3 / 6

Hash (cost=139.16..139.16 rows=6,916 width=12) (actual time=5.587..5.588 rows=6,916 loops=3)

  • Buffers: shared hit=210
19. 1.860 1.860 ↑ 1.0 6,916 3 / 6

Seq Scan on writer_consumer_stats s (cost=0..139.16 rows=6,916 width=12) (actual time=0.06..3.72 rows=6,916 loops=3)

  • Buffers: shared hit=210
Planning time : 2.577 ms
Execution time : 24,007.067 ms