explain.depesz.com

PostgreSQL's explain analyze made readable

Result: eKP7

Settings
# exclusive inclusive rows x rows loops node
1. 0.014 5,278.258 ↓ 2.5 20 1

Limit (cost=715.03..267,229.68 rows=8 width=51) (actual time=5,278.232..5,278.258 rows=20 loops=1)

2. 806.238 5,278.244 ↓ 2.5 20 1

Nested Loop (cost=715.03..267,229.68 rows=8 width=51) (actual time=5,278.230..5,278.244 rows=20 loops=1)

  • Join Filter: (ev.tipoevento_id = tp.id)
  • Rows Removed by Join Filter: 4635977
3. 0.836 0.836 ↑ 3.9 187 1

Seq Scan on tipoevento tp (cost=0.00..19.20 rows=720 width=43) (actual time=0.009..0.836 rows=187 loops=1)

4. 548.959 4,471.170 ↓ 3,098.9 24,791 187

Materialize (cost=715.03..267,124.10 rows=8 width=24) (actual time=17.438..23.910 rows=24,791 loops=187)

5. 0.000 3,922.211 ↓ 3,115.4 24,923 1

Nested Loop Left Join (cost=715.03..267,124.06 rows=8 width=24) (actual time=3,260.791..3,922.211 rows=24,923 loops=1)

  • Filter: (atuacaoalerta.* IS NULL)
6. 1,231.151 3,872.851 ↓ 16.4 24,923 1

Hash Join (cost=714.61..265,711.48 rows=1,524 width=24) (actual time=3,260.756..3,872.851 rows=24,923 loops=1)

  • Hash Cond: (ev.viagem_id = v.id)
7. 2,641.156 2,641.156 ↓ 1.0 6,613,530 1

Seq Scan on eventoviagem ev (cost=0.00..240,518.37 rows=6,523,537 width=24) (actual time=0.057..2,641.156 rows=6,613,530 loops=1)

8. 0.054 0.544 ↑ 2.4 125 1

Hash (cost=710.81..710.81 rows=304 width=8) (actual time=0.544..0.544 rows=125 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
9. 0.490 0.490 ↑ 2.4 125 1

Index Scan using idx_viagem_status on viagem v (cost=0.43..710.81 rows=304 width=8) (actual time=0.054..0.490 rows=125 loops=1)

  • Index Cond: (status = ANY ('{V,I}'::bpchar[]))
10. 49.846 49.846 ↓ 0.0 0 24,923

Index Scan using idx_atuacaoalerta_eventoviagem_id on atuacaoalerta (cost=0.42..0.75 rows=18 width=672) (actual time=0.002..0.002 rows=0 loops=24,923)

  • Index Cond: (eventoviagem_id = ev.id)
Planning time : 1.081 ms
Execution time : 5,278.930 ms