explain.depesz.com

PostgreSQL's explain analyze made readable

Result: z18 : busca ponto

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 587.345 ↓ 1.2 10 1

Limit (cost=8,552.08..8,552.36 rows=8 width=614) (actual time=587.217..587.345 rows=10 loops=1)

2. 0.107 587.342 ↓ 1.2 10 1

Unique (cost=8,552.08..8,552.36 rows=8 width=614) (actual time=587.216..587.342 rows=10 loops=1)

3. 1.876 587.235 ↓ 56.4 451 1

Sort (cost=8,552.08..8,552.10 rows=8 width=614) (actual time=587.214..587.235 rows=451 loops=1)

  • Sort Key: pontoviage0_.nome, pontoviage0_.id, pontoviage0_.ativo, pontoviage0_.cnpj, pontoviage0_.contato, pontoviage0_.documento, pontoviage0_.email_id, pontoviage0_.empresa_id, pontoviage0_.endereco_id, pontoviage0_.fronteira_id, pontoviage0_.numeroeixos, pontoviage0_.tempomedio, pontoviage0_.tipo
  • Sort Method: quicksort Memory: 260kB
4. 2.735 585.359 ↓ 137.8 1,102 1

Nested Loop Left Join (cost=39.55..8,551.96 rows=8 width=614) (actual time=55.380..585.359 rows=1,102 loops=1)

  • Join Filter: (empresa1_.id = localidade2_.empresa_id)
  • Rows Removed by Join Filter: 42340
5. 48.086 580.296 ↓ 8.0 24 1

Nested Loop (cost=39.55..8,436.11 rows=3 width=622) (actual time=54.938..580.296 rows=24 loops=1)

6. 47.014 79.654 ↓ 249.8 75,426 1

Hash Left Join (cost=38.99..6,577.52 rows=302 width=622) (actual time=0.258..79.654 rows=75,426 loops=1)

  • Hash Cond: (pontoviage0_.empresa_id = empresa1_.id)
  • Filter: ((empresa1_.id = 225) OR (empresa1_.id IS NULL))
  • Rows Removed by Filter: 150617
7. 32.420 32.420 ↑ 1.0 226,043 1

Seq Scan on pontoviagem pontoviage0_ (cost=0.00..5,936.70 rows=227,749 width=614) (actual time=0.015..32.420 rows=226,043 loops=1)

  • Filter: ativo
  • Rows Removed by Filter: 1538
8. 0.089 0.220 ↓ 1.0 762 1

Hash (cost=29.55..29.55 rows=755 width=8) (actual time=0.220..0.220 rows=762 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 38kB
9. 0.131 0.131 ↓ 1.0 762 1

Seq Scan on empresa empresa1_ (cost=0.00..29.55 rows=755 width=8) (actual time=0.006..0.131 rows=762 loops=1)

10. 452.556 452.556 ↓ 0.0 0 75,426

Index Scan using endereco_pkey on endereco endereco4_ (cost=0.56..6.14 rows=1 width=19) (actual time=0.006..0.006 rows=0 loops=75,426)

  • Index Cond: (id = pontoviage0_.endereco_id)
  • Filter: ((upper(to_ascii(convert_to((pontoviage0_.nome)::text, 'latin1'::name), 'latin1'::name)) ~~ upper(to_ascii(convert_to('%intec%'::text, 'latin1'::name), 'latin1'::name))) OR (upper((pontoviage0_.cnpj)::text) ~~ '%intec%'::text) OR (upper(to_ascii(convert_to((cidade)::text, 'latin1'::name), 'latin1'::name)) ~~ upper(to_ascii(convert_to('%intec%'::text, 'latin1'::name), 'latin1'::name))))
  • Rows Removed by Filter: 1
11. 2.185 2.328 ↓ 1.0 1,810 24

Materialize (cost=0.00..39.09 rows=1,806 width=16) (actual time=0.002..0.097 rows=1,810 loops=24)

12. 0.143 0.143 ↓ 1.0 1,810 1

Seq Scan on empresa_localidade localidade2_ (cost=0.00..30.06 rows=1,806 width=16) (actual time=0.014..0.143 rows=1,810 loops=1)

Planning time : 17.590 ms
Execution time : 593.005 ms