explain.depesz.com

PostgreSQL's explain analyze made readable

Result: psHd : simples

Settings
# exclusive inclusive rows x rows loops node
1. 1.263 2,676.449 ↑ 2.5 1,351 1

Sort (cost=275,702.72..275,711.11 rows=3,356 width=634) (actual time=2,676.206..2,676.449 rows=1,351 loops=1)

  • Sort Key: p.data
  • Sort Method: quicksort Memory: 300kB
2. 0.518 2,675.186 ↑ 2.5 1,351 1

Hash Left Join (cost=8,918.25..275,506.18 rows=3,356 width=634) (actual time=346.522..2,675.186 rows=1,351 loops=1)

  • Hash Cond: (eve.tipoevento_id = te.id)
3. 691.814 2,674.139 ↑ 2.5 1,351 1

Hash Right Join (cost=8,890.05..275,431.84 rows=3,356 width=599) (actual time=345.968..2,674.139 rows=1,351 loops=1)

  • Hash Cond: (eve.posicao_id = p.id)
4. 1,730.057 1,730.057 ↑ 1.0 6,636,994 1

Seq Scan on eventoviagem eve (cost=0.00..241,652.94 rows=6,636,994 width=16) (actual time=0.047..1,730.057 rows=6,636,994 loops=1)

5. 1.285 252.268 ↓ 1.4 1,351 1

Hash (cost=8,877.80..8,877.80 rows=980 width=591) (actual time=252.268..252.268 rows=1,351 loops=1)

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 170kB
6. 1.360 250.983 ↓ 1.4 1,351 1

Hash Left Join (cost=6.41..8,877.80 rows=980 width=591) (actual time=0.097..250.983 rows=1,351 loops=1)

  • Hash Cond: (p.rastreador_id = rastreador.id)
7. 3.763 249.604 ↓ 1.4 1,351 1

Nested Loop (cost=4.99..8,863.48 rows=980 width=83) (actual time=0.070..249.604 rows=1,351 loops=1)

8. 6.714 6.714 ↓ 1.4 1,351 1

Index Scan using idx_viagem_posicao_viagem_id on viagem_posicao vp (cost=0.42..452.38 rows=980 width=8) (actual time=0.041..6.714 rows=1,351 loops=1)

  • Index Cond: (viagem_id = 1310351)
9. 221.564 239.127 ↑ 1.0 1 1,351

Bitmap Heap Scan on posicao p (cost=4.56..8.57 rows=1 width=83) (actual time=0.177..0.177 rows=1 loops=1,351)

  • Recheck Cond: (id = vp.posicao_id)
  • Heap Blocks: exact=1351
10. 17.563 17.563 ↑ 1.0 1 1,351

Bitmap Index Scan on posicao_pkey (cost=0.00..4.56 rows=1 width=0) (actual time=0.013..0.013 rows=1 loops=1,351)

  • Index Cond: (id = vp.posicao_id)
11. 0.008 0.019 ↓ 1.1 20 1

Hash (cost=1.19..1.19 rows=19 width=524) (actual time=0.019..0.019 rows=20 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
12. 0.011 0.011 ↓ 1.1 20 1

Seq Scan on rastreador (cost=0.00..1.19 rows=19 width=524) (actual time=0.007..0.011 rows=20 loops=1)

13. 0.239 0.529 ↓ 1.0 721 1

Hash (cost=19.20..19.20 rows=720 width=43) (actual time=0.529..0.529 rows=721 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 64kB
14. 0.290 0.290 ↓ 1.0 721 1

Seq Scan on tipoevento te (cost=0.00..19.20 rows=720 width=43) (actual time=0.012..0.290 rows=721 loops=1)

Planning time : 1.005 ms
Execution time : 2,676.678 ms