explain.depesz.com

PostgreSQL's explain analyze made readable

Result: uEWj : busca evento

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 4,211.431 ↑ 1.0 20 1

Limit (cost=186,068.71..186,068.76 rows=20 width=583) (actual time=4,211.424..4,211.431 rows=20 loops=1)

2. 9.884 4,211.425 ↑ 1.1 20 1

Sort (cost=186,068.71..186,068.77 rows=21 width=583) (actual time=4,211.423..4,211.425 rows=20 loops=1)

  • Sort Key: ev.id DESC
  • Sort Method: top-N heapsort Memory: 27kB
3. 56.292 4,201.541 ↓ 1,652.2 34,696 1

Nested Loop Left Join (cost=5,324.59..186,068.25 rows=21 width=583) (actual time=1,866.801..4,201.541 rows=34,696 loops=1)

  • Join Filter: (rastreador.id = sinal.software_id)
  • Rows Removed by Join Filter: 659224
4. 18.749 4,110.553 ↓ 1,652.2 34,696 1

Nested Loop Left Join (cost=5,324.59..186,060.70 rows=21 width=75) (actual time=1,866.776..4,110.553 rows=34,696 loops=1)

5. 0.000 4,057.108 ↓ 1,652.2 34,696 1

Nested Loop Left Join (cost=5,324.30..186,053.80 rows=21 width=75) (actual time=1,866.766..4,057.108 rows=34,696 loops=1)

6. 1,962.199 3,991.137 ↓ 1,652.2 34,696 1

Nested Loop (cost=5,323.88..185,919.17 rows=21 width=67) (actual time=1,866.727..3,991.137 rows=34,696 loops=1)

  • Join Filter: (ev.tipoevento_id = tp.id)
  • Rows Removed by Join Filter: 24946424
7. 0.698 0.698 ↑ 1.0 720 1

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

8. 906.258 2,028.240 ↓ 1,652.2 34,696 720

Materialize (cost=5,323.88..185,673.22 rows=21 width=40) (actual time=1.202..2.817 rows=34,696 loops=720)

9. 10.719 1,121.982 ↓ 1,652.2 34,696 1

Nested Loop Left Join (cost=5,323.88..185,673.12 rows=21 width=40) (actual time=865.344..1,121.982 rows=34,696 loops=1)

  • Filter: (atuacaoalerta.* IS NULL)
  • Rows Removed by Filter: 12
10. 512.324 1,076.556 ↓ 8.4 34,707 1

Hash Join (cost=5,323.45..181,829.10 rows=4,148 width=40) (actual time=865.328..1,076.556 rows=34,707 loops=1)

  • Hash Cond: (ev.viagem_id = v.id)
11. 564.053 564.053 ↑ 1.0 6,590,049 1

Seq Scan on eventoviagem ev (cost=0.00..151,751.49 rows=6,590,049 width=32) (actual time=0.013..564.053 rows=6,590,049 loops=1)

12. 0.017 0.179 ↑ 10.0 82 1

Hash (cost=5,313.16..5,313.16 rows=823 width=16) (actual time=0.179..0.179 rows=82 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
13. 0.162 0.162 ↑ 10.0 82 1

Index Scan using idx_viagem_status on viagem v (cost=0.43..5,313.16 rows=823 width=16) (actual time=0.020..0.162 rows=82 loops=1)

  • Index Cond: (status = ANY ('{V,I}'::bpchar[]))
  • Filter: (base_id = ANY ('{29,109,71,103,104,35,24,97,58,90,89,83,63,21,0}'::bigint[]))
  • Rows Removed by Filter: 1
14. 34.707 34.707 ↓ 0.0 0 34,707

Index Scan using idx_atuacaoalerta_eventoviagem_id on atuacaoalerta (cost=0.42..0.75 rows=18 width=677) (actual time=0.001..0.001 rows=0 loops=34,707)

  • Index Cond: (eventoviagem_id = ev.id)
15. 69.392 69.392 ↑ 1.0 1 34,696

Index Scan using automovel_pkey on automovel auto (cost=0.42..6.40 rows=1 width=16) (actual time=0.001..0.002 rows=1 loops=34,696)

  • Index Cond: (v.veiculo_id = id)
16. 34.696 34.696 ↑ 1.0 1 34,696

Index Scan using idx_sinal_automovel_id on sinal (cost=0.29..0.32 rows=1 width=16) (actual time=0.001..0.001 rows=1 loops=34,696)

  • Index Cond: (automovel_id = auto.id)
17. 34.688 34.696 ↑ 1.0 20 34,696

Materialize (cost=0.00..1.30 rows=20 width=524) (actual time=0.000..0.001 rows=20 loops=34,696)

18. 0.008 0.008 ↑ 1.0 20 1

Seq Scan on rastreador (cost=0.00..1.20 rows=20 width=524) (actual time=0.006..0.008 rows=20 loops=1)

Planning time : 2.028 ms
Execution time : 4,211.989 ms