explain.depesz.com

PostgreSQL's explain analyze made readable

Result: p5NM

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.006 15.894 ↑ 1.0 10 1

Limit (cost=2,670.03..2,670.06 rows=10 width=20) (actual time=15.889..15.894 rows=10 loops=1)

  • Buffers: shared hit=1248
2. 0.143 15.888 ↑ 79.0 10 1

Sort (cost=2,670.03..2,672.01 rows=790 width=20) (actual time=15.887..15.888 rows=10 loops=1)

  • Sort Key: (count(t1.usuario)) DESC
  • Sort Method: top-N heapsort Memory: 26kB
  • Buffers: shared hit=1248
3. 0.819 15.745 ↑ 1.3 606 1

Aggregate (cost=2,497.53..2,652.96 rows=790 width=20) (actual time=13.164..15.745 rows=606 loops=1)

  • Buffers: shared hit=1245
4. 1.449 14.926 ↑ 1.5 4,735 1

Merge Join (cost=2,497.53..2,609.26 rows=7,161 width=12) (actual time=13.156..14.926 rows=4,735 loops=1)

  • Buffers: shared hit=1245
5. 1.645 4.391 ↓ 1.1 1,968 1

Sort (cost=162.82..167.43 rows=1,842 width=6) (actual time=4.254..4.391 rows=1,968 loops=1)

  • Sort Key: t2.usuario
  • Sort Method: quicksort Memory: 141kB
  • Buffers: shared hit=29
6. 0.615 2.746 ↓ 1.1 1,968 1

Hash Join (cost=4.87..62.92 rows=1,842 width=6) (actual time=0.156..2.746 rows=1,968 loops=1)

  • Buffers: shared hit=29
7. 0.789 2.110 ↓ 1.1 1,968 1

Hash Join (cost=3.44..55.58 rows=1,842 width=8) (actual time=0.105..2.11 rows=1,968 loops=1)

  • Buffers: shared hit=25
8. 0.844 1.280 ↓ 1.1 1,968 1

Hash Join (cost=1.27..48.18 rows=1,842 width=14) (actual time=0.049..1.28 rows=1,968 loops=1)

  • Buffers: shared hit=24
9. 0.421 0.421 ↑ 1.0 1,996 1

Seq Scan on candidatos t2 (cost=0..39.96 rows=1,996 width=16) (actual time=0.006..0.421 rows=1,996 loops=1)

  • Buffers: shared hit=20
10. 0.009 0.015 ↑ 1.0 12 1

Hash (cost=1.12..1.12 rows=12 width=3) (actual time=0.015..0.015 rows=12 loops=1)

  • Buffers: shared hit=1
11. 0.006 0.006 ↑ 1.0 12 1

Seq Scan on coaliciones t3 (cost=0..1.12 rows=12 width=3) (actual time=0.003..0.006 rows=12 loops=1)

  • Buffers: shared hit=1
12. 0.023 0.041 ↑ 1.0 52 1

Hash (cost=1.52..1.52 rows=52 width=10) (actual time=0.04..0.041 rows=52 loops=1)

  • Buffers: shared hit=1
13. 0.018 0.018 ↑ 1.0 52 1

Seq Scan on provincias provincias (cost=0..1.52 rows=52 width=10) (actual time=0.006..0.018 rows=52 loops=1)

  • Buffers: shared hit=1
14. 0.010 0.021 ↑ 1.0 19 1

Hash (cost=1.19..1.19 rows=19 width=2) (actual time=0.021..0.021 rows=19 loops=1)

  • Buffers: shared hit=1
15. 0.011 0.011 ↑ 1.0 19 1

Seq Scan on ccaa ccaa (cost=0..1.19 rows=19 width=2) (actual time=0.007..0.011 rows=19 loops=1)

  • Buffers: shared hit=1
16. 4.901 9.086 ↓ 1.1 5,541 1

Sort (cost=2,329.84..2,342.63 rows=5,117 width=12) (actual time=8.711..9.086 rows=5,541 loops=1)

  • Sort Key: t1.usuario
  • Sort Method: quicksort Memory: 450kB
  • Buffers: shared hit=1216
17. 4.185 4.185 ↓ 1.1 5,490 1

Index Scan using tui_ind_tie on tuiteos t1 (cost=0.42..2,014.6 rows=5,117 width=12) (actual time=0.051..4.185 rows=5,490 loops=1)

  • Index Cond: ((t1.tiempo >= '2019-04-10 23:06:30'::timestamp without time zone) AND (t1.tiempo <= '2019-04-11 23:06:30'::timestamp without time zone))
  • Buffers: shared hit=1216