explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aKhu : recempon

Settings
# exclusive inclusive rows x rows loops node
1. 0.028 1.224 ↑ 2.0 2 1

Sort (cost=137.90..137.91 rows=4 width=1,366) (actual time=1.218..1.224 rows=2 loops=1)

  • Sort Key: rmac_20190805.rmac_data_computador_bordo
  • Sort Method: quicksort Memory: 26kB
2. 0.019 1.196 ↑ 2.0 2 1

Nested Loop (cost=27.17..137.86 rows=4 width=1,366) (actual time=0.945..1.196 rows=2 loops=1)

3. 0.017 1.159 ↑ 2.0 2 1

Nested Loop Left Join (cost=27.03..136.78 rows=4 width=1,362) (actual time=0.923..1.159 rows=2 loops=1)

4. 0.026 1.132 ↑ 2.0 2 1

Hash Left Join (cost=26.75..134.61 rows=4 width=1,358) (actual time=0.908..1.132 rows=2 loops=1)

  • Hash Cond: (vter_viagem_terminal.vter_viag_codigo = viag_viagem.viag_codigo)
  • Join Filter: ((rmac_20190805.rmac_data_computador_bordo >= viag_viagem.viag_data_inicio) AND (rmac_20190805.rmac_data_computador_bordo <= COALESCE((viag_viagem.viag_data_fim)::timestamp with time zone, now())))
5. 0.014 0.387 ↑ 2.0 2 1

Nested Loop Left Join (cost=4.58..112.43 rows=4 width=1,354) (actual time=0.172..0.387 rows=2 loops=1)

6. 0.012 0.349 ↑ 1.0 2 1

Append (cost=0.29..103.52 rows=2 width=1,350) (actual time=0.147..0.349 rows=2 loops=1)

7. 0.013 0.180 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.29..51.82 rows=1 width=1,533) (actual time=0.143..0.180 rows=1 loops=1)

  • Filter: (emco_20190805.emco_codigo IS NULL)
8. 0.017 0.127 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.14..30.08 rows=1 width=1,501) (actual time=0.095..0.127 rows=1 loops=1)

  • Join Filter: (rcin_recebimento_cfp_invalido.rcin_rmac_rece_codigo = rmac_20190805.rmac_rece_codigo)
  • Rows Removed by Join Filter: 3
  • Filter: (rcin_recebimento_cfp_invalido.rcin_codigo IS NULL)
9. 0.008 0.057 ↑ 4.0 1 1

Append (cost=0.14..28.86 rows=4 width=1,500) (actual time=0.029..0.057 rows=1 loops=1)

10. 0.010 0.010 ↓ 0.0 0 1

Index Scan using rmac_20190805_beg_07 on rmac_20190805 (cost=0.14..8.18 rows=1 width=1,896) (actual time=0.008..0.010 rows=0 loops=1)

  • Index Cond: ((rmac_term_numero_terminal)::text = '50173'::text)
  • Filter: ((rmac_data_cadastro >= '2019-08-05 08:00:00'::timestamp without time zone) AND (rmac_vtec_codigo = 6604) AND (rmac_tmac_codigo = ANY ('{115,116,121,122,118,120,125,126,123,124,137,138,3,139,140}'::integer[])))
11. 0.021 0.021 ↑ 1.0 1 1

Index Scan using rmac_20190806_beg_07 on rmac_20190806 (cost=0.14..8.18 rows=1 width=1,896) (actual time=0.014..0.021 rows=1 loops=1)

  • Index Cond: ((rmac_term_numero_terminal)::text = '50173'::text)
  • Filter: ((rmac_data_cadastro >= '2019-08-05 08:00:00'::timestamp without time zone) AND (rmac_vtec_codigo = 6604) AND (rmac_tmac_codigo = ANY ('{115,116,121,122,118,120,125,126,123,124,137,138,3,139,140}'::integer[])))
12. 0.010 0.010 ↓ 0.0 0 1

Index Scan using rmac_20190807_beg_06 on rmac_20190807 (cost=0.28..4.32 rows=1 width=312) (actual time=0.009..0.010 rows=0 loops=1)

  • Index Cond: (rmac_vtec_codigo = 6604)
  • Filter: ((rmac_data_cadastro >= '2019-08-05 08:00:00'::timestamp without time zone) AND ((rmac_term_numero_terminal)::text = '50173'::text) AND (rmac_tmac_codigo = ANY ('{115,116,121,122,118,120,125,126,123,124,137,138,3,139,140}'::integer[])))
13. 0.008 0.008 ↓ 0.0 0 1

Index Scan using rmac_20190808_beg_07 on rmac_20190808 (cost=0.14..8.18 rows=1 width=1,896) (actual time=0.006..0.008 rows=0 loops=1)

  • Index Cond: ((rmac_term_numero_terminal)::text = '50173'::text)
  • Filter: ((rmac_data_cadastro >= '2019-08-05 08:00:00'::timestamp without time zone) AND (rmac_vtec_codigo = 6604) AND (rmac_tmac_codigo = ANY ('{115,116,121,122,118,120,125,126,123,124,137,138,3,139,140}'::integer[])))
14. 0.018 0.053 ↑ 1.0 3 1

Materialize (cost=0.00..1.04 rows=3 width=8) (actual time=0.033..0.053 rows=3 loops=1)

15. 0.035 0.035 ↑ 1.0 3 1

Seq Scan on rcin_recebimento_cfp_invalido (cost=0.00..1.03 rows=3 width=8) (actual time=0.026..0.035 rows=3 loops=1)

16. 0.006 0.040 ↓ 0.0 0 1

Append (cost=0.15..21.70 rows=4 width=12) (actual time=0.039..0.040 rows=0 loops=1)

17. 0.009 0.009 ↓ 0.0 0 1

Index Scan using emco_20190805_beg_05 on emco_20190805 (cost=0.15..6.17 rows=1 width=12) (actual time=0.007..0.009 rows=0 loops=1)

  • Index Cond: ((emco_rmac_rece_codigo = rmac_20190805.rmac_rece_codigo) AND (emco_espa_codigo = 666))
  • Filter: (emco_data_cadastro >= '2019-08-05 08:00:00'::timestamp without time zone)
18. 0.008 0.008 ↓ 0.0 0 1

Index Scan using emco_20190806_beg_05 on emco_20190806 (cost=0.15..5.17 rows=1 width=12) (actual time=0.006..0.008 rows=0 loops=1)

  • Index Cond: ((emco_rmac_rece_codigo = rmac_20190805.rmac_rece_codigo) AND (emco_espa_codigo = 666))
  • Filter: (emco_data_cadastro >= '2019-08-05 08:00:00'::timestamp without time zone)
19. 0.009 0.009 ↓ 0.0 0 1

Index Scan using emco_20190807_beg_05 on emco_20190807 (cost=0.15..5.17 rows=1 width=12) (actual time=0.007..0.009 rows=0 loops=1)

  • Index Cond: ((emco_rmac_rece_codigo = rmac_20190805.rmac_rece_codigo) AND (emco_espa_codigo = 666))
  • Filter: (emco_data_cadastro >= '2019-08-05 08:00:00'::timestamp without time zone)
20. 0.008 0.008 ↓ 0.0 0 1

Index Scan using emco_20190808_beg_05 on emco_20190808 (cost=0.15..5.17 rows=1 width=12) (actual time=0.006..0.008 rows=0 loops=1)

  • Index Cond: ((emco_rmac_rece_codigo = rmac_20190805.rmac_rece_codigo) AND (emco_espa_codigo = 666))
  • Filter: (emco_data_cadastro >= '2019-08-05 08:00:00'::timestamp without time zone)
21. 0.013 0.157 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.29..51.69 rows=1 width=1,167) (actual time=0.123..0.157 rows=1 loops=1)

  • Filter: (elco_20190805.elco_codigo IS NULL)
22. 0.016 0.105 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.14..29.95 rows=1 width=1,103) (actual time=0.075..0.105 rows=1 loops=1)

  • Join Filter: (rcin_recebimento_cfp_invalido_1.rcin_rmac_rece_codigo = rmli_20190805.rmli_rece_codigo)
  • Rows Removed by Join Filter: 3
  • Filter: (rcin_recebimento_cfp_invalido_1.rcin_codigo IS NULL)
23. 0.010 0.054 ↑ 4.0 1 1

Append (cost=0.14..28.73 rows=4 width=1,102) (actual time=0.027..0.054 rows=1 loops=1)

24. 0.011 0.011 ↓ 0.0 0 1

Index Scan using rmli_20190805_beg_05 on rmli_20190805 (cost=0.14..8.18 rows=1 width=1,380) (actual time=0.009..0.011 rows=0 loops=1)

  • Index Cond: ((rmli_term_numero_terminal)::text = '50173'::text)
  • Filter: ((rmli_data_cadastro >= '2019-08-05 08:00:00'::timestamp without time zone) AND (rmli_vtec_codigo = 6604) AND (rmli_mlpa_codigo = ANY ('{115,116,121,122,118,120,125,126,123,124,137,138,3,139,140}'::integer[])))
25. 0.016 0.016 ↑ 1.0 1 1

Index Scan using rmli_20190806_beg_05 on rmli_20190806 (cost=0.14..8.18 rows=1 width=1,380) (actual time=0.012..0.016 rows=1 loops=1)

  • Index Cond: ((rmli_term_numero_terminal)::text = '50173'::text)
  • Filter: ((rmli_data_cadastro >= '2019-08-05 08:00:00'::timestamp without time zone) AND (rmli_vtec_codigo = 6604) AND (rmli_mlpa_codigo = ANY ('{115,116,121,122,118,120,125,126,123,124,137,138,3,139,140}'::integer[])))
26. 0.009 0.009 ↓ 0.0 0 1

Index Scan using rmli_20190807_beg_04 on rmli_20190807 (cost=0.14..4.19 rows=1 width=269) (actual time=0.007..0.009 rows=0 loops=1)

  • Index Cond: (rmli_vtec_codigo = 6604)
  • Filter: ((rmli_data_cadastro >= '2019-08-05 08:00:00'::timestamp without time zone) AND ((rmli_term_numero_terminal)::text = '50173'::text) AND (rmli_mlpa_codigo = ANY ('{115,116,121,122,118,120,125,126,123,124,137,138,3,139,140}'::integer[])))
27. 0.008 0.008 ↓ 0.0 0 1

Index Scan using rmli_20190808_beg_05 on rmli_20190808 (cost=0.14..8.18 rows=1 width=1,380) (actual time=0.007..0.008 rows=0 loops=1)

  • Index Cond: ((rmli_term_numero_terminal)::text = '50173'::text)
  • Filter: ((rmli_data_cadastro >= '2019-08-05 08:00:00'::timestamp without time zone) AND (rmli_vtec_codigo = 6604) AND (rmli_mlpa_codigo = ANY ('{115,116,121,122,118,120,125,126,123,124,137,138,3,139,140}'::integer[])))
28. 0.017 0.035 ↑ 1.0 3 1

Materialize (cost=0.00..1.04 rows=3 width=8) (actual time=0.014..0.035 rows=3 loops=1)

29. 0.018 0.018 ↑ 1.0 3 1

Seq Scan on rcin_recebimento_cfp_invalido rcin_recebimento_cfp_invalido_1 (cost=0.00..1.03 rows=3 width=8) (actual time=0.009..0.018 rows=3 loops=1)

30. 0.008 0.039 ↓ 0.0 0 1

Append (cost=0.15..21.70 rows=4 width=12) (actual time=0.037..0.039 rows=0 loops=1)

31. 0.009 0.009 ↓ 0.0 0 1

Index Scan using elco_20190805_beg_05 on elco_20190805 (cost=0.15..6.17 rows=1 width=12) (actual time=0.007..0.009 rows=0 loops=1)

  • Index Cond: ((elco_rmli_rece_codigo = rmli_20190805.rmli_rece_codigo) AND (elco_espa_codigo = 666))
  • Filter: (elco_data_cadastro >= '2019-08-05 08:00:00'::timestamp without time zone)
32. 0.007 0.007 ↓ 0.0 0 1

Index Scan using elco_20190806_beg_05 on elco_20190806 (cost=0.15..5.17 rows=1 width=12) (actual time=0.005..0.007 rows=0 loops=1)

  • Index Cond: ((elco_rmli_rece_codigo = rmli_20190805.rmli_rece_codigo) AND (elco_espa_codigo = 666))
  • Filter: (elco_data_cadastro >= '2019-08-05 08:00:00'::timestamp without time zone)
33. 0.008 0.008 ↓ 0.0 0 1

Index Scan using elco_20190807_beg_05 on elco_20190807 (cost=0.15..5.17 rows=1 width=12) (actual time=0.006..0.008 rows=0 loops=1)

  • Index Cond: ((elco_rmli_rece_codigo = rmli_20190805.rmli_rece_codigo) AND (elco_espa_codigo = 666))
  • Filter: (elco_data_cadastro >= '2019-08-05 08:00:00'::timestamp without time zone)
34. 0.007 0.007 ↓ 0.0 0 1

Index Scan using elco_20190808_beg_05 on elco_20190808 (cost=0.15..5.17 rows=1 width=12) (actual time=0.006..0.007 rows=0 loops=1)

  • Index Cond: ((elco_rmli_rece_codigo = rmli_20190805.rmli_rece_codigo) AND (elco_espa_codigo = 666))
  • Filter: (elco_data_cadastro >= '2019-08-05 08:00:00'::timestamp without time zone)
35. 0.007 0.024 ↓ 0.0 0 2

Materialize (cost=4.29..8.86 rows=2 width=4) (actual time=0.011..0.012 rows=0 loops=2)

36. 0.006 0.017 ↓ 0.0 0 1

Bitmap Heap Scan on vter_viagem_terminal (cost=4.29..8.85 rows=2 width=4) (actual time=0.015..0.017 rows=0 loops=1)

  • Recheck Cond: (vter_term_codigo = 114842)
37. 0.011 0.011 ↓ 0.0 0 1

Bitmap Index Scan on vter_viagem_terminal_idx_70507 (cost=0.00..4.29 rows=2 width=0) (actual time=0.009..0.011 rows=0 loops=1)

  • Index Cond: (vter_term_codigo = 114842)
38. 0.280 0.719 ↑ 1.4 107 1

Hash (cost=20.26..20.26 rows=153 width=24) (actual time=0.718..0.719 rows=107 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
39. 0.439 0.439 ↑ 1.4 107 1

Seq Scan on viag_viagem (cost=0.00..20.26 rows=153 width=24) (actual time=0.040..0.439 rows=107 loops=1)

  • Filter: ((viag_data_inicio IS NOT NULL) AND (viag_data_inicio <> COALESCE((viag_data_fim)::timestamp with time zone, now())))
  • Rows Removed by Filter: 371
40. 0.010 0.010 ↓ 0.0 0 2

Index Scan using vvei_viagem_veiculo_idx_70579 on vvei_viagem_veiculo (cost=0.27..0.53 rows=1 width=8) (actual time=0.004..0.005 rows=0 loops=2)

  • Index Cond: ((vvei_viag_codigo = viag_viagem.viag_codigo) AND ((vvei_ativo)::text = 'S'::text) AND ((vvei_precedencia)::text = '1'::text))
41. 0.018 0.018 ↑ 1.0 1 2

Index Scan using veic_veiculo_pkey on veic_veiculo (cost=0.15..0.27 rows=1 width=8) (actual time=0.008..0.009 rows=1 loops=2)

  • Index Cond: (COALESCE(vvei_viagem_veiculo.vvei_veic_oras_codigo, 3082703) = veic_oras_codigo)
Planning time : 157.432 ms
Execution time : 1.869 ms