explain.depesz.com

PostgreSQL's explain analyze made readable

Result: XkVm

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

Limit (cost=32,112,738.60..32,112,743.10 rows=100 width=463) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=32,112,738.60..32,122,246.42 rows=211,285 width=463) (actual rows= loops=)

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

Sort (cost=32,112,738.60..32,113,266.81 rows=211,285 width=459) (actual rows= loops=)

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

Nested Loop (cost=140,216.96..32,049,997.17 rows=211,285 width=459) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=140,215.64..31,868,785.76 rows=29,491 width=459) (actual rows= loops=)

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

Hash Left Join (cost=140,215.64..31,790,915.63 rows=29,273 width=446) (actual rows= loops=)

  • Hash Cond: (c.pes_id = gc.pes_idcliente)
7. 0.000 0.000 ↓ 0.0

Hash Join (cost=140,181.51..31,790,679.83 rows=29,273 width=442) (actual rows= loops=)

  • Hash Cond: (v.pes_idcliente = p_1.pes_id)
8. 0.000 0.000 ↓ 0.0

Nested Loop (cost=137,827.13..31,788,126.86 rows=29,273 width=417) (actual rows= loops=)

  • Join Filter: ((relatoriosdiarios.sgr_id = v.sgr_id) OR (relatoriosdiarios.sgr_id = v.sgr_id2))
9. 0.000 0.000 ↓ 0.0

Unique (cost=137,827.13..140,039.95 rows=26,510 width=379) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Sort (cost=137,827.13..138,933.54 rows=442,563 width=379) (actual rows= loops=)

  • Sort Key: relatoriosdiarios.sgr_id, relatoriosdiarios.data DESC
11. 0.000 0.000 ↓ 0.0

Seq Scan on relatoriosdiarios (cost=0.00..19,177.63 rows=442,563 width=379) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..3,204.16 rows=68,211 width=46) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Seq Scan on veiculo v (cost=0.00..2,863.11 rows=68,211 width=46) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Hash (cost=2,306.35..2,306.35 rows=3,842 width=37) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,249.83..2,306.35 rows=3,842 width=37) (actual rows= loops=)

  • Hash Cond: (p_1.pes_id = c.pes_id)
16. 0.000 0.000 ↓ 0.0

Seq Scan on pessoa p_1 (cost=0.00..970.62 rows=12,662 width=4) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Hash (cost=1,201.80..1,201.80 rows=3,842 width=33) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Hash Join (cost=197.94..1,201.80 rows=3,842 width=33) (actual rows= loops=)

  • Hash Cond: (p.pes_id = c.pes_id)
19. 0.000 0.000 ↓ 0.0

Seq Scan on pessoa p (cost=0.00..970.62 rows=12,662 width=29) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Hash (cost=149.91..149.91 rows=3,842 width=4) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Index Only Scan using pk_tbrhcliente on cliente c (cost=0.28..149.91 rows=3,842 width=4) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Hash (cost=19.06..19.06 rows=1,206 width=8) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Seq Scan on grupocliente gc (cost=0.00..19.06 rows=1,206 width=8) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..4.33 rows=152 width=25) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Seq Scan on grupo g (cost=0.00..3.57 rows=152 width=25) (actual rows= loops=)

  • Filter: gru_isativo
26. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on relatoriosdiarios r (cost=1.32..5.81 rows=33 width=8) (actual rows= loops=)

  • Recheck Cond: ((sgr_id = v.sgr_id) OR (sgr_id = v.sgr_id2))
27. 0.000 0.000 ↓ 0.0

BitmapOr (cost=1.32..1.32 rows=33 width=0) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on pk_relatoriosdiarios (cost=0.00..0.65 rows=17 width=0) (actual rows= loops=)

  • Index Cond: (sgr_id = v.sgr_id)
29. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on pk_relatoriosdiarios (cost=0.00..0.65 rows=17 width=0) (actual rows= loops=)

  • Index Cond: (sgr_id = v.sgr_id2)