explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9cv2 : aaaaa

Settings
# exclusive inclusive rows x rows loops node
1. 0.039 12.757 ↓ 8.0 8 1

Sort (cost=2,448.93..2,448.93 rows=1 width=385) (actual time=12.757..12.757 rows=8 loops=1)

  • Sort Key: rmac_20200511.rmac_data_computador_bordo, (CASE WHEN (rmac_20200511.rmac_tmac_codigo = 115) THEN 0 WHEN (rmac_20200511.rmac_tmac_codigo = 116) THEN 2 ELSE 1 END)
  • Sort Method: quicksort Memory: 29kB
2. 0.013 12.718 ↓ 8.0 8 1

Nested Loop Left Join (cost=2,382.41..2,448.92 rows=1 width=385) (actual time=11.915..12.718 rows=8 loops=1)

  • Filter: (COALESCE(mtra_viag.mtra_codigo, mtra_prop.mtra_codigo) IS NOT NULL)
3. 0.009 12.665 ↓ 8.0 8 1

Nested Loop Left Join (cost=2,382.12..2,448.55 rows=1 width=377) (actual time=11.893..12.665 rows=8 loops=1)

4. 0.012 12.616 ↓ 8.0 8 1

Nested Loop (cost=2,381.84..2,446.82 rows=1 width=365) (actual time=11.863..12.616 rows=8 loops=1)

5. 0.002 12.564 ↓ 8.0 8 1

Nested Loop Left Join (cost=2,381.55..2,444.52 rows=1 width=373) (actual time=11.840..12.564 rows=8 loops=1)

6. 0.014 12.506 ↓ 8.0 8 1

Nested Loop Left Join (cost=2,381.27..2,442.20 rows=1 width=369) (actual time=11.808..12.506 rows=8 loops=1)

7. 0.013 12.468 ↓ 8.0 8 1

Nested Loop Left Join (cost=2,380.98..2,440.95 rows=1 width=365) (actual time=11.799..12.468 rows=8 loops=1)

  • Join Filter: ((rmac_20200511.rmac_data_computador_bordo >= viag_viagem.viag_data_inicio) AND (rmac_20200511.rmac_data_computador_bordo <= COALESCE((viag_viagem.viag_data_fim)::timestamp with time zone, now())))
  • Rows Removed by Join Filter: 5
8. 0.026 11.671 ↓ 8.0 8 1

Nested Loop (cost=2,380.40..2,384.75 rows=1 width=357) (actual time=11.607..11.671 rows=8 loops=1)

9. 0.003 11.581 ↓ 4.0 8 1

Limit (cost=2,380.12..2,380.12 rows=2 width=364) (actual time=11.577..11.581 rows=8 loops=1)

10. 0.047 11.578 ↓ 4.0 8 1

Sort (cost=2,380.12..2,380.12 rows=2 width=364) (actual time=11.576..11.578 rows=8 loops=1)

  • Sort Key: rmac_20200511.rmac_data_computador_bordo
  • Sort Method: quicksort Memory: 29kB
11. 0.003 11.531 ↓ 4.0 8 1

Append (cost=0.00..2,380.11 rows=2 width=364) (actual time=1.763..11.531 rows=8 loops=1)

12. 0.024 11.384 ↓ 8.0 8 1

Nested Loop Left Join (cost=0.00..2,354.45 rows=1 width=363) (actual time=1.763..11.384 rows=8 loops=1)

  • Join Filter: (rcin_recebimento_cfp_invalido.rcin_rmac_rece_codigo = rmac_20200511.rmac_rece_codigo)
  • Rows Removed by Join Filter: 96
  • Filter: (rcin_recebimento_cfp_invalido.rcin_codigo IS NULL)
13. 0.011 11.336 ↑ 1.0 8 1

Append (cost=0.00..2,352.26 rows=8 width=331) (actual time=1.736..11.336 rows=8 loops=1)

14. 5.554 5.554 ↑ 4.0 1 1

Seq Scan on rmac_20200511 (cost=0.00..1,091.29 rows=4 width=331) (actual time=1.730..5.554 rows=1 loops=1)

  • Filter: ((rmac_data_cadastro >= '2020-05-11 00:00:00'::timestamp without time zone) AND (rmac_data_cadastro <= '2020-05-13 00:00:00'::timestamp without time zone) AND (rmac_dat (...)
  • Rows Removed by Filter: 9814
15. 5.748 5.748 ↓ 2.3 7 1

Seq Scan on rmac_20200512 (cost=0.00..1,258.63 rows=3 width=330) (actual time=0.782..5.748 rows=7 loops=1)

  • Filter: ((rmac_data_cadastro >= '2020-05-11 00:00:00'::timestamp without time zone) AND (rmac_data_cadastro <= '2020-05-13 00:00:00'::timestamp without time zone) AND (rmac_dat (...)
  • Rows Removed by Filter: 11678
16. 0.023 0.023 ↓ 0.0 0 1

Index Scan using rmac_20200513_beg_04 on rmac_20200513 (cost=0.29..2.34 rows=1 width=333) (actual time=0.023..0.023 rows=0 loops=1)

  • Index Cond: ((rmac_data_cadastro >= '2020-05-11 00:00:00'::timestamp without time zone) AND (rmac_data_cadastro <= '2020-05-13 00:00:00'::timestamp without time zone))
  • Filter: ((rmac_data_computador_bordo >= '2020-05-11 00:00:00'::timestamp without time zone) AND (rmac_data_computador_bordo <= '2020-05-13 00:00:00'::timestamp without time zon (...)
17. 0.012 0.024 ↓ 1.3 12 8

Materialize (cost=0.00..1.14 rows=9 width=8) (actual time=0.002..0.003 rows=12 loops=8)

18. 0.012 0.012 ↓ 1.3 12 1

Seq Scan on rcin_recebimento_cfp_invalido (cost=0.00..1.09 rows=9 width=8) (actual time=0.009..0.012 rows=12 loops=1)

19. 0.001 0.144 ↓ 0.0 0 1

Hash Left Join (cost=1.20..25.63 rows=1 width=366) (actual time=0.144..0.144 rows=0 loops=1)

  • Hash Cond: (rmli_20200511.rmli_rece_codigo = rcin_recebimento_cfp_invalido_1.rcin_rmac_rece_codigo)
  • Filter: (rcin_recebimento_cfp_invalido_1.rcin_codigo IS NULL)
20. 0.001 0.143 ↓ 0.0 0 1

Append (cost=0.00..24.39 rows=3 width=302) (actual time=0.143..0.143 rows=0 loops=1)

21. 0.075 0.075 ↓ 0.0 0 1

Seq Scan on rmli_20200511 (cost=0.00..13.72 rows=1 width=302) (actual time=0.075..0.075 rows=0 loops=1)

  • Filter: ((rmli_data_cadastro >= '2020-05-11 00:00:00'::timestamp without time zone) AND (rmli_data_cadastro <= '2020-05-13 00:00:00'::timestamp without time zone) AND (rmli_dat (...)
  • Rows Removed by Filter: 113
22. 0.049 0.049 ↓ 0.0 0 1

Seq Scan on rmli_20200512 (cost=0.00..8.46 rows=1 width=301) (actual time=0.049..0.049 rows=0 loops=1)

  • Filter: ((rmli_data_cadastro >= '2020-05-11 00:00:00'::timestamp without time zone) AND (rmli_data_cadastro <= '2020-05-13 00:00:00'::timestamp without time zone) AND (rmli_dat (...)
  • Rows Removed by Filter: 84
23. 0.018 0.018 ↓ 0.0 0 1

Index Scan using rmli_20200513_beg_01 on rmli_20200513 (cost=0.14..2.20 rows=1 width=303) (actual time=0.018..0.018 rows=0 loops=1)

  • Index Cond: ((rmli_data_cadastro >= '2020-05-11 00:00:00'::timestamp without time zone) AND (rmli_data_cadastro <= '2020-05-13 00:00:00'::timestamp without time zone))
  • Filter: ((rmli_data_computador_bordo >= '2020-05-11 00:00:00'::timestamp without time zone) AND (rmli_data_computador_bordo <= '2020-05-13 00:00:00'::timestamp without time zon (...)
24. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.09..1.09 rows=9 width=8) (never executed)

25. 0.000 0.000 ↓ 0.0 0

Seq Scan on rcin_recebimento_cfp_invalido rcin_recebimento_cfp_invalido_1 (cost=0.00..1.09 rows=9 width=8) (never executed)

26. 0.064 0.064 ↑ 1.0 1 8

Index Scan using term_terminal_beg_i01 on term_terminal (cost=0.28..2.30 rows=1 width=23) (actual time=0.008..0.008 rows=1 loops=8)

  • Index Cond: (((term_numero_terminal)::text = (rmac_20200511.rmac_term_numero_terminal)::text) AND (term_vtec_codigo = rmac_20200511.rmac_vtec_codigo))
27. 0.000 0.784 ↑ 1.0 1 8

Nested Loop (cost=0.58..56.18 rows=1 width=24) (actual time=0.029..0.098 rows=1 loops=8)

28. 0.264 0.264 ↓ 1.6 22 8

Index Scan using vmoo_moto_pfis_pess_oras_codigo_idx_10000 on vmoo_viagem_motorista (cost=0.29..23.73 rows=14 width=4) (actual time=0.005..0.033 rows=22 loops=8)

  • Index Cond: (vmoo_moto_pfis_pess_oras_codigo = 1073623)
  • Filter: (vmoo_ativo = 'S'::bpchar)
  • Rows Removed by Filter: 11
29. 0.528 0.528 ↓ 0.0 0 176

Index Scan using viag_viagem_pkey on viag_viagem (cost=0.29..2.32 rows=1 width=24) (actual time=0.003..0.003 rows=0 loops=176)

  • Index Cond: (viag_codigo = vmoo_viagem_motorista.vmoo_viag_codigo)
  • Filter: ((viag_data_inicio IS NOT NULL) AND (viag_data_inicio >= '2020-05-11 00:00:00'::timestamp without time zone) AND (viag_data_inicio <= '2020-05-13 00:00:00'::timestamp without time zone) AND (viag_da (...)
  • Rows Removed by Filter: 1
30. 0.024 0.024 ↓ 0.0 0 8

Index Scan using vvei_viagem_veiculo_idx_70579 on vvei_viagem_veiculo (cost=0.29..1.24 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=8)

  • Index Cond: ((vvei_viag_codigo = viag_viagem.viag_codigo) AND ((vvei_ativo)::text = 'S'::text) AND ((vvei_precedencia)::text = '1'::text))
31. 0.056 0.056 ↑ 1.0 1 8

Index Scan using beg_mvel_motorista_veiculo_mvel_moto_pfis_pess_oras_codigo_i on mvel_motorista_veiculo (cost=0.28..2.31 rows=1 width=4) (actual time=0.006..0.007 rows=1 loops=8)

  • Index Cond: (mvel_moto_pfis_pess_oras_codigo = 1073623)
  • Filter: ((mvel_ativo = 'S'::bpchar) AND ((mvel_precedencia)::text = '1'::text))
32. 0.040 0.040 ↑ 1.0 1 8

Index Scan using veic_veiculo_pkey on veic_veiculo (cost=0.29..2.31 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=8)

  • Index Cond: (COALESCE(vvei_viagem_veiculo.vvei_veic_oras_codigo, rmac_20200511.rmac_oras_codigo, mvel_motorista_veiculo.mvel_veic_oras_codigo, term_terminal.term_oras_codigo) = veic_oras_codigo)
33. 0.040 0.040 ↓ 0.0 0 8

Index Scan using mtra_motorista_trans_idx_71003 on mtra_motorista_transportador mtra_viag (cost=0.29..1.01 rows=1 width=16) (actual time=0.005..0.005 rows=0 loops=8)

  • Index Cond: ((mtra_tran_pess_oras_codigo = viag_viagem.viag_tran_pess_oras_codigo) AND (mtra_moto_pfis_pess_oras_codigo = 1073623))
  • Filter: (mtra_cjmo_codigo IS NOT NULL)
34. 0.040 0.040 ↑ 1.0 1 8

Index Scan using mtra_motorista_trans_idx_71003 on mtra_motorista_transportador mtra_prop (cost=0.29..0.35 rows=1 width=12) (actual time=0.005..0.005 rows=1 loops=8)

  • Index Cond: ((mtra_tran_pess_oras_codigo = veic_veiculo.veic_pess_oras_codigo_propri) AND (mtra_moto_pfis_pess_oras_codigo = 1073623))
  • Filter: (mtra_cjmo_codigo IS NOT NULL)
Planning time : 31.539 ms
Execution time : 13.477 ms