explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1HJb

Settings
# exclusive inclusive rows x rows loops node
1. 0.007 0.740 ↑ 1.0 6 1

Limit (cost=151.88..201.04 rows=6 width=2,813) (actual time=0.607..0.740 rows=6 loops=1)

2. 0.019 0.733 ↑ 7,228.1 24 1

Nested Loop Left Join (cost=4.40..1,421,360.37 rows=173,474 width=2,813) (actual time=0.093..0.733 rows=24 loops=1)

  • Join Filter: ("Coleta".fk_tipo_veiculo = "TipoVeiculo".codigo)
  • Rows Removed by Join Filter: 168
3. 0.022 0.690 ↑ 7,228.1 24 1

Nested Loop Left Join (cost=4.40..1,397,466.12 rows=173,474 width=2,802) (actual time=0.088..0.690 rows=24 loops=1)

4. 0.022 0.668 ↑ 7,228.1 24 1

Nested Loop Left Join (cost=4.12..1,302,993.60 rows=173,474 width=2,777) (actual time=0.086..0.668 rows=24 loops=1)

5. 0.024 0.646 ↑ 7,228.1 24 1

Nested Loop Left Join (cost=3.84..1,252,188.47 rows=173,474 width=2,764) (actual time=0.084..0.646 rows=24 loops=1)

  • Join Filter: ("Coleta".fk_tipo_coleta = "TipoColeta".codigo)
  • Rows Removed by Join Filter: 24
6. 0.023 0.622 ↑ 7,228.1 24 1

Nested Loop Left Join (cost=3.84..1,247,850.60 rows=173,474 width=2,756) (actual time=0.080..0.622 rows=24 loops=1)

7. 0.072 0.575 ↑ 7,228.1 24 1

Nested Loop Left Join (cost=3.56..1,196,239.99 rows=173,474 width=2,730) (actual time=0.075..0.575 rows=24 loops=1)

  • Join Filter: ("Remessa".fk_estado = ("Remessa.Estado".sigla)::bpchar)
  • Rows Removed by Join Filter: 615
8. 0.035 0.455 ↑ 7,228.1 24 1

Nested Loop Left Join (cost=3.56..1,125,981.68 rows=173,474 width=1,701) (actual time=0.065..0.455 rows=24 loops=1)

9. 0.051 0.396 ↑ 7,228.1 24 1

Nested Loop (cost=3.42..1,097,808.40 rows=173,474 width=1,677) (actual time=0.060..0.396 rows=24 loops=1)

10. 0.017 0.081 ↑ 7,228.1 24 1

Hash Left Join (cost=2.85..11,311.16 rows=173,474 width=1,457) (actual time=0.039..0.081 rows=24 loops=1)

  • Hash Cond: (("Coleta".fk_estado_coleta)::text = ("EstadoColetar".sigla)::text)
11. 0.032 0.052 ↑ 7,228.1 24 1

Hash Left Join (cost=1.25..10,782.71 rows=173,474 width=428) (actual time=0.023..0.052 rows=24 loops=1)

  • Hash Cond: ("Coleta"."TipoDocumentoCodigo" = "TipoDocumento".codigo)
12. 0.012 0.012 ↑ 7,228.1 24 1

Seq Scan on "Coleta" (cost=0.00..10,150.74 rows=173,474 width=415) (actual time=0.007..0.012 rows=24 loops=1)

13. 0.004 0.008 ↑ 1.0 11 1

Hash (cost=1.11..1.11 rows=11 width=17) (actual time=0.008..0.008 rows=11 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
14. 0.004 0.004 ↑ 1.0 11 1

Seq Scan on "TipoDocumento" (cost=0.00..1.11 rows=11 width=17) (actual time=0.003..0.004 rows=11 loops=1)

15. 0.006 0.012 ↑ 1.0 27 1

Hash (cost=1.27..1.27 rows=27 width=1,032) (actual time=0.012..0.012 rows=27 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
16. 0.006 0.006 ↑ 1.0 27 1

Seq Scan on "Estado" "EstadoColetar" (cost=0.00..1.27 rows=27 width=1,032) (actual time=0.003..0.006 rows=27 loops=1)

17. 0.264 0.264 ↑ 1.0 1 24

Index Scan using "Remessa_pkey" on "Remessa" (cost=0.56..6.26 rows=1 width=232) (actual time=0.011..0.011 rows=1 loops=24)

  • Index Cond: ((codigo)::text = ("Coleta".fk_remessa)::text)
18. 0.024 0.024 ↑ 1.0 1 24

Index Scan using "Servico_pkey" on "Servico" "Remessa.Servico" (cost=0.14..0.16 rows=1 width=28) (actual time=0.001..0.001 rows=1 loops=24)

  • Index Cond: ("Remessa".fk_servico = codigo)
19. 0.043 0.048 ↑ 1.0 27 24

Materialize (cost=0.00..1.41 rows=27 width=1,032) (actual time=0.000..0.002 rows=27 loops=24)

20. 0.005 0.005 ↑ 1.0 27 1

Seq Scan on "Estado" "Remessa.Estado" (cost=0.00..1.27 rows=27 width=1,032) (actual time=0.001..0.005 rows=27 loops=1)

21. 0.024 0.024 ↑ 1.0 1 24

Index Scan using "CentroCustoCliente_pkey" on "CentroCustoCliente" "Remessa.CentroCustoCliente" (cost=0.28..0.30 rows=1 width=30) (actual time=0.001..0.001 rows=1 loops=24)

  • Index Cond: ("Remessa".fk_centro_custo = codigo)
22. 0.000 0.000 ↑ 1.0 2 24

Materialize (cost=0.00..1.03 rows=2 width=12) (actual time=0.000..0.000 rows=2 loops=24)

23. 0.002 0.002 ↑ 1.0 2 1

Seq Scan on "TipoColeta" (cost=0.00..1.02 rows=2 width=12) (actual time=0.002..0.002 rows=2 loops=1)

24. 0.000 0.000 ↓ 0.0 0 24

Index Scan using "RotaColetaEntrega_pkey" on "RotaColetaEntrega" "RotaPadrao" (cost=0.28..0.29 rows=1 width=17) (actual time=0.000..0.000 rows=0 loops=24)

  • Index Cond: ("Coleta".fk_rota = codigo)
25. 0.000 0.000 ↓ 0.0 0 24

Index Scan using "Entregador_pkey" on "Entregador" "MotoristaPadrao" (cost=0.28..0.54 rows=1 width=29) (actual time=0.000..0.000 rows=0 loops=24)

  • Index Cond: ("Coleta".fk_entregador = codigo)
26. 0.022 0.024 ↑ 1.2 8 24

Materialize (cost=0.00..1.15 rows=10 width=11) (actual time=0.000..0.001 rows=8 loops=24)

27. 0.002 0.002 ↑ 1.2 8 1

Seq Scan on "TipoVeiculo" (cost=0.00..1.10 rows=10 width=11) (actual time=0.002..0.002 rows=8 loops=1)

Planning time : 5.961 ms