explain.depesz.com

PostgreSQL's explain analyze made readable

Result: uYwD

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

Aggregate (cost=2,548,430.41..2,548,430.42 rows=1 width=8) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2,544,129.83..2,547,303.38 rows=450,813 width=0) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Finalize GroupAggregate (cost=2,544,129.83..2,544,300.38 rows=200 width=16) (actual rows= loops=)

  • Group Key: historico_comando_26.veiculo_id
4. 0.000 0.000 ↓ 0.0

Gather Merge (cost=2,544,129.83..2,544,296.38 rows=400 width=16) (actual rows= loops=)

  • Workers Planned: 2
5. 0.000 0.000 ↓ 0.0

Partial GroupAggregate (cost=2,543,129.80..2,543,250.18 rows=200 width=16) (actual rows= loops=)

  • Group Key: historico_comando_26.veiculo_id
6. 0.000 0.000 ↓ 0.0

Sort (cost=2,543,129.80..2,543,169.26 rows=15,784 width=16) (actual rows= loops=)

  • Sort Key: historico_comando_26.veiculo_id
7. 0.000 0.000 ↓ 0.0

Result (cost=8,548.43..2,542,029.17 rows=15,784 width=16) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Parallel Append (cost=8,548.43..2,541,871.33 rows=15,784 width=16) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Parallel Bitmap Heap Scan on historico_comando historico_comando_26 (cost=19,640.97..257,572.55 rows=95 width=16) (actual rows= loops=)

  • Recheck Cond: (regra_motorista_id IS NOT NULL)
  • Filter: ((comando_id = 23) AND ("right"((conteudo)::text, 5) = 'QTD|3'::text))
10. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_2019_09_historico_comando_regra_motorista_id (cost=0.00..19,640.91 rows=1,357,931 width=0) (actual rows= loops=)

  • Index Cond: (regra_motorista_id IS NOT NULL)
11. 0.000 0.000 ↓ 0.0

Parallel Bitmap Heap Scan on historico_comando historico_comando_25 (cost=8,548.43..97,612.26 rows=218 width=16) (actual rows= loops=)

  • Recheck Cond: (regra_motorista_id IS NOT NULL)
  • Filter: ((comando_id = 23) AND ("right"((conteudo)::text, 5) = 'QTD|3'::text))
12. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_2019_08_historico_comando_regra_motorista_id (cost=0.00..8,548.30 rows=590,650 width=0) (actual rows= loops=)

  • Index Cond: (regra_motorista_id IS NOT NULL)
13. 0.000 0.000 ↓ 0.0

Parallel Bitmap Heap Scan on historico_comando historico_comando_23 (cost=6,743.16..170,054.86 rows=223 width=16) (actual rows= loops=)

  • Recheck Cond: (regra_motorista_id IS NOT NULL)
  • Filter: ((comando_id = 23) AND ("right"((conteudo)::text, 5) = 'QTD|3'::text))
14. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_2019_06_historico_comando_regra_motorista_id (cost=0.00..6,743.03 rows=465,147 width=0) (actual rows= loops=)

  • Index Cond: (regra_motorista_id IS NOT NULL)
15. 0.000 0.000 ↓ 0.0

Parallel Bitmap Heap Scan on historico_comando historico_comando_22 (cost=4,326.81..116,327.94 rows=139 width=16) (actual rows= loops=)

  • Recheck Cond: (regra_motorista_id IS NOT NULL)
  • Filter: ((comando_id = 23) AND ("right"((conteudo)::text, 5) = 'QTD|3'::text))
16. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_2019_05_historico_comando_regra_motorista_id (cost=0.00..4,326.73 rows=298,440 width=0) (actual rows= loops=)

  • Index Cond: (regra_motorista_id IS NOT NULL)
17. 0.000 0.000 ↓ 0.0

Parallel Bitmap Heap Scan on historico_comando historico_comando_24 (cost=2,355.69..135,618.95 rows=25 width=16) (actual rows= loops=)

  • Recheck Cond: (regra_motorista_id IS NOT NULL)
  • Filter: ((comando_id = 23) AND ("right"((conteudo)::text, 5) = 'QTD|3'::text))
18. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_2019_07_historico_comando_regra_motorista_id (cost=0.00..2,355.67 rows=162,566 width=0) (actual rows= loops=)

  • Index Cond: (regra_motorista_id IS NOT NULL)
19. 0.000 0.000 ↓ 0.0

Parallel Index Scan using idx_2018_08_historico_comando_regra_motorista_id on historico_comando historico_comando_13 (cost=0.42..6.13 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (regra_motorista_id IS NOT NULL)
  • Filter: ((comando_id = 23) AND ("right"((conteudo)::text, 5) = 'QTD|3'::text))
20. 0.000 0.000 ↓ 0.0

Parallel Index Scan using idx_2018_07_historico_comando_regra_motorista_id on historico_comando historico_comando_12 (cost=0.29..4.63 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (regra_motorista_id IS NOT NULL)
  • Filter: ((comando_id = 23) AND ("right"((conteudo)::text, 5) = 'QTD|3'::text))
21. 0.000 0.000 ↓ 0.0

Parallel Index Scan using idx_2018_06_historico_comando_regra_motorista_id on historico_comando historico_comando_11 (cost=0.29..4.31 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (regra_motorista_id IS NOT NULL)
  • Filter: ((comando_id = 23) AND ("right"((conteudo)::text, 5) = 'QTD|3'::text))
22. 0.000 0.000 ↓ 0.0

Parallel Index Scan using idx_2018_05_historico_comando_regra_motorista_id on historico_comando historico_comando_10 (cost=0.29..4.31 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (regra_motorista_id IS NOT NULL)
  • Filter: ((comando_id = 23) AND ("right"((conteudo)::text, 5) = 'QTD|3'::text))
23. 0.000 0.000 ↓ 0.0

Parallel Index Scan using idx_2018_04_historico_comando_regra_motorista_id on historico_comando historico_comando_9 (cost=0.29..4.30 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (regra_motorista_id IS NOT NULL)
  • Filter: ((comando_id = 23) AND ("right"((conteudo)::text, 5) = 'QTD|3'::text))
24. 0.000 0.000 ↓ 0.0

Parallel Index Scan using idx_2018_02_historico_comando_regra_motorista_id on historico_comando historico_comando_7 (cost=0.28..4.30 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (regra_motorista_id IS NOT NULL)
  • Filter: ((comando_id = 23) AND ("right"((conteudo)::text, 5) = 'QTD|3'::text))
25. 0.000 0.000 ↓ 0.0

Parallel Index Scan using idx_2018_03_historico_comando_regra_motorista_id on historico_comando historico_comando_8 (cost=0.28..4.30 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (regra_motorista_id IS NOT NULL)
  • Filter: ((comando_id = 23) AND ("right"((conteudo)::text, 5) = 'QTD|3'::text))
26. 0.000 0.000 ↓ 0.0

Parallel Index Scan using idx_2018_01_historico_comando_regra_motorista_id on historico_comando historico_comando_6 (cost=0.28..4.29 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (regra_motorista_id IS NOT NULL)
  • Filter: ((comando_id = 23) AND ("right"((conteudo)::text, 5) = 'QTD|3'::text))
27. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on historico_comando historico_comando_27 (cost=0.00..436,577.07 rows=33 width=16) (actual rows= loops=)

  • Filter: ((regra_motorista_id IS NOT NULL) AND (comando_id = 23) AND ("right"((conteudo)::text, 5) = 'QTD|3'::text))
28. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on historico_comando historico_comando_28 (cost=0.00..387,846.89 rows=22 width=16) (actual rows= loops=)

  • Filter: ((regra_motorista_id IS NOT NULL) AND (comando_id = 23) AND ("right"((conteudo)::text, 5) = 'QTD|3'::text))
29. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on historico_comando historico_comando_21 (cost=0.00..340,689.94 rows=383 width=16) (actual rows= loops=)

  • Filter: ((regra_motorista_id IS NOT NULL) AND (comando_id = 23) AND ("right"((conteudo)::text, 5) = 'QTD|3'::text))
30. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on historico_comando historico_comando_19 (cost=0.00..173,753.23 rows=6,532 width=16) (actual rows= loops=)

  • Filter: ((regra_motorista_id IS NOT NULL) AND (comando_id = 23) AND ("right"((conteudo)::text, 5) = 'QTD|3'::text))
31. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on historico_comando historico_comando_30 (cost=0.00..146,866.84 rows=15 width=16) (actual rows= loops=)

  • Filter: ((regra_motorista_id IS NOT NULL) AND (comando_id = 23) AND ("right"((conteudo)::text, 5) = 'QTD|3'::text))
32. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on historico_comando historico_comando_20 (cost=0.00..108,315.56 rows=4,253 width=16) (actual rows= loops=)

  • Filter: ((regra_motorista_id IS NOT NULL) AND (comando_id = 23) AND ("right"((conteudo)::text, 5) = 'QTD|3'::text))
33. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on historico_comando historico_comando_29 (cost=0.00..68,459.61 rows=44 width=16) (actual rows= loops=)

  • Filter: ((regra_motorista_id IS NOT NULL) AND (comando_id = 23) AND ("right"((conteudo)::text, 5) = 'QTD|3'::text))
34. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on historico_comando historico_comando_14 (cost=0.00..33,869.64 rows=1,539 width=16) (actual rows= loops=)

  • Filter: ((regra_motorista_id IS NOT NULL) AND (comando_id = 23) AND ("right"((conteudo)::text, 5) = 'QTD|3'::text))
35. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on historico_comando historico_comando_17 (cost=0.00..17,041.10 rows=774 width=16) (actual rows= loops=)

  • Filter: ((regra_motorista_id IS NOT NULL) AND (comando_id = 23) AND ("right"((conteudo)::text, 5) = 'QTD|3'::text))
36. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on historico_comando historico_comando_15 (cost=0.00..16,758.43 rows=593 width=16) (actual rows= loops=)

  • Filter: ((regra_motorista_id IS NOT NULL) AND (comando_id = 23) AND ("right"((conteudo)::text, 5) = 'QTD|3'::text))
37. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on historico_comando historico_comando_18 (cost=0.00..14,076.72 rows=533 width=16) (actual rows= loops=)

  • Filter: ((regra_motorista_id IS NOT NULL) AND (comando_id = 23) AND ("right"((conteudo)::text, 5) = 'QTD|3'::text))
38. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on historico_comando historico_comando_31 (cost=0.00..10,863.00 rows=2 width=16) (actual rows= loops=)

  • Filter: ((regra_motorista_id IS NOT NULL) AND (comando_id = 23) AND ("right"((conteudo)::text, 5) = 'QTD|3'::text))
39. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on historico_comando historico_comando_16 (cost=0.00..9,429.61 rows=350 width=16) (actual rows= loops=)

  • Filter: ((regra_motorista_id IS NOT NULL) AND (comando_id = 23) AND ("right"((conteudo)::text, 5) = 'QTD|3'::text))
40. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on historico_comando_fallback (cost=0.00..10.82 rows=1 width=16) (actual rows= loops=)

  • Filter: ((regra_motorista_id IS NOT NULL) AND (comando_id = 23) AND ("right"((conteudo)::text, 5) = 'QTD|3'::text))
41. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on historico_comando historico_comando_32 (cost=0.00..10.82 rows=1 width=16) (actual rows= loops=)

  • Filter: ((regra_motorista_id IS NOT NULL) AND (comando_id = 23) AND ("right"((conteudo)::text, 5) = 'QTD|3'::text))
42. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on historico_comando historico_comando_5 (cost=0.00..0.00 rows=1 width=16) (actual rows= loops=)

  • Filter: ((regra_motorista_id IS NOT NULL) AND (comando_id = 23) AND ("right"((conteudo)::text, 5) = 'QTD|3'::text))
43. 0.000 0.000 ↓ 0.0

Append (cost=0.00..14.96 rows=5 width=8) (actual rows= loops=)

44. 0.000 0.000 ↓ 0.0

Seq Scan on historico_comando (cost=0.00..0.00 rows=1 width=8) (actual rows= loops=)

  • Filter: ((datahora_criacao >= '2019-12-22 15:32:01.605501'::timestamp without time zone) AND (status_id = 4) AND ((max(historico_comando_26.id)) = id))
45. 0.000 0.000 ↓ 0.0

Index Scan using pk_2019_12_historico_comando on historico_comando historico_comando_1 (cost=0.43..4.43 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id = (max(historico_comando_26.id)))
  • Filter: ((datahora_criacao >= '2019-12-22 15:32:01.605501'::timestamp without time zone) AND (status_id = 4))
46. 0.000 0.000 ↓ 0.0

Index Scan using pk_2020_01_historico_comando on historico_comando historico_comando_2 (cost=0.43..4.45 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id = (max(historico_comando_26.id)))
  • Filter: ((datahora_criacao >= '2019-12-22 15:32:01.605501'::timestamp without time zone) AND (status_id = 4))
47. 0.000 0.000 ↓ 0.0

Index Scan using pk_2020_02_historico_comando on historico_comando historico_comando_3 (cost=0.42..4.26 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id = (max(historico_comando_26.id)))
  • Filter: ((datahora_criacao >= '2019-12-22 15:32:01.605501'::timestamp without time zone) AND (status_id = 4))
48. 0.000 0.000 ↓ 0.0

Index Scan using pk_2020_03_historico_comando on historico_comando historico_comando_4 (cost=0.14..1.79 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id = (max(historico_comando_26.id)))
  • Filter: ((datahora_criacao >= '2019-12-22 15:32:01.605501'::timestamp without time zone) AND (status_id = 4))