explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6iW

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Unique (cost=4,163.53..4,163.65 rows=1 width=658) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=4,163.53..4,163.65 rows=1 width=658) (actual rows= loops=)

  • Group Key: r.sgr_id, v.vei_placa, v.vei_nome, v.mrc_nome, v.mdl_nome, v.vei_ano, g.gru_nome, p.pes_nome, ultreportokcan.status_can, ultreportokj1587.status_j1587, ultreportokobd.status_obd
3. 0.000 0.000 ↓ 0.0

Sort (cost=4,163.53..4,163.54 rows=1 width=805) (actual rows= loops=)

  • Sort Key: r.sgr_id, v.vei_placa, v.vei_nome, v.mrc_nome, v.mdl_nome, v.vei_ano, g.gru_nome, p.pes_nome, ultreportokcan.status_can, ultreportokj1587.status_j1587, ultreportokobd.status_obd
4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.13..4,163.52 rows=1 width=805) (actual rows= loops=)

  • Join Filter: ((ultreportokobd.sgr_id = v.sgr_id) OR (ultreportokobd.sgr_id = v.sgr_id2))
5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.13..4,150.89 rows=1 width=781) (actual rows= loops=)

  • Join Filter: ((ultreportokj1587.sgr_id = v.sgr_id) OR (ultreportokj1587.sgr_id = v.sgr_id2))
6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.13..4,138.26 rows=1 width=691) (actual rows= loops=)

  • Join Filter: ((ultreportokcan.sgr_id = v.sgr_id) OR (ultreportokcan.sgr_id = v.sgr_id2))
7. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1.13..4,125.63 rows=1 width=478) (actual rows= loops=)

  • Join Filter: ((g.gru_id = gc.gru_id) OR (g.gru_id = c.pes_id))
8. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1.13..4,102.16 rows=1 width=418) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.85..4,084.69 rows=1 width=414) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..4,084.35 rows=1 width=422) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.29..4,083.81 rows=1 width=393) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..4,077.51 rows=1 width=389) (actual rows= loops=)

  • Join Filter: ((r.sgr_id = v.sgr_id) OR (r.sgr_id = v.sgr_id2))
13. 0.000 0.000 ↓ 0.0

Seq Scan on relatoriosdiarios r (cost=0.00..8.21 rows=221 width=343) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..4,061.57 rows=2 width=46) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Seq Scan on veiculo v (cost=0.00..4,061.55 rows=2 width=46) (actual rows= loops=)

  • Filter: ((sgr_id = 245502) OR (sgr_id2 = 245502))
16. 0.000 0.000 ↓ 0.0

Index Only Scan using pk_tbrhpessoa on pessoa p_1 (cost=0.29..6.30 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (pes_id = v.pes_idcliente)
17. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbrhpessoa on pessoa p (cost=0.29..0.54 rows=1 width=29) (actual rows= loops=)

  • Index Cond: (pes_id = p_1.pes_id)
18. 0.000 0.000 ↓ 0.0

Index Only Scan using pk_tbrhcliente on cliente c (cost=0.28..0.34 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (pes_id = p_1.pes_id)
19. 0.000 0.000 ↓ 0.0

Index Only Scan using pk_tbrhgrupocliente on grupocliente gc (cost=0.28..17.36 rows=11 width=8) (actual rows= loops=)

  • Index Cond: (pes_idcliente = c.pes_id)
20. 0.000 0.000 ↓ 0.0

Seq Scan on grupo g (cost=0.00..17.70 rows=385 width=72) (actual rows= loops=)

  • Filter: gru_isativo
21. 0.000 0.000 ↓ 0.0

Seq Scan on relatoriosdiarios ultreportokcan (cost=0.00..9.31 rows=221 width=217) (actual rows= loops=)

  • Filter: ((status_can IS NULL) OR (array_to_string(status_can, ','::text) !~~ '%ERRO%'::text))
22. 0.000 0.000 ↓ 0.0

Seq Scan on relatoriosdiarios ultreportokj1587 (cost=0.00..9.31 rows=221 width=94) (actual rows= loops=)

  • Filter: ((status_j1587 IS NULL) OR (array_to_string(status_j1587, ','::text) !~~ '%ERRO%'::text))
23. 0.000 0.000 ↓ 0.0

Seq Scan on relatoriosdiarios ultreportokobd (cost=0.00..9.31 rows=221 width=36) (actual rows= loops=)

  • Filter: ((status_obd IS NULL) OR (array_to_string(status_obd, ','::text) !~~ '%ERRO%'::text))