explain.depesz.com

PostgreSQL's explain analyze made readable

Result: O8su

Settings
# exclusive inclusive rows x rows loops node
1. 0.092 137.374 ↑ 419.0 34 1

Sort (cost=31,270.96..31,306.58 rows=14,247 width=33) (actual time=137.371..137.374 rows=34 loops=1)

  • Sort Key: (((q.setor)::text = '[SETOR DESCONHECIDO]'::text)), q.setor
  • Sort Method: quicksort Memory: 27kB
2. 0.008 137.282 ↑ 419.0 34 1

Subquery Scan on q (cost=29,967.48..30,288.04 rows=14,247 width=33) (actual time=137.195..137.282 rows=34 loops=1)

3. 0.101 137.274 ↑ 419.0 34 1

HashAggregate (cost=29,967.48..30,109.95 rows=14,247 width=32) (actual time=137.194..137.274 rows=34 loops=1)

  • Group Key: (("*SELECT* 1".setor)::character varying)
4. 0.007 137.173 ↑ 419.0 34 1

Append (cost=29,646.92..29,931.86 rows=14,247 width=32) (actual time=137.085..137.173 rows=34 loops=1)

5. 0.006 137.165 ↑ 431.7 33 1

Subquery Scan on *SELECT* 1 (cost=29,646.92..29,931.84 rows=14,246 width=32) (actual time=137.085..137.165 rows=33 loops=1)

6. 5.308 137.159 ↑ 431.7 33 1

HashAggregate (cost=29,646.92..29,789.38 rows=14,246 width=44) (actual time=137.083..137.159 rows=33 loops=1)

  • Group Key: g.nm_geometria
7. 5.191 131.851 ↑ 1.2 12,297 1

Gather (cost=1,001.73..29,611.31 rows=14,246 width=44) (actual time=0.512..131.851 rows=12,297 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
8. 29.932 126.660 ↑ 1.4 6,148 2

Nested Loop (cost=1.73..27,186.71 rows=8,380 width=44) (actual time=0.124..126.660 rows=6,148 loops=2)

9. 63.270 96.727 ↓ 3.4 28,117 2

Nested Loop (cost=1.30..23,138.30 rows=8,380 width=4) (actual time=0.099..96.727 rows=28,117 loops=2)

10. 22.365 33.451 ↓ 2.4 9,765 2

Nested Loop (cost=0.86..19,767.32 rows=4,056 width=4) (actual time=0.088..33.451 rows=9,765 loops=2)

11. 11.081 11.081 ↓ 1.2 3,772 2

Parallel Index Scan using ind_tb_rd_idfilial_dtini_idveiculo_idrd on tb_rd rd (cost=0.43..11,486.93 rows=3,130 width=4) (actual time=0.077..11.081 rows=3,772 loops=2)

  • Index Cond: (((id_filial)::integer = 47) AND (dt_inicio_terminal >= '2018-01-01 00:00:00'::timestamp without time zone) AND (dt_inicio_terminal <= '2018-12-31 23:59:00'::timestamp without time zone))
  • Filter: ((id_modelo_coleta)::integer = 1)
  • Rows Removed by Filter: 4248
12. 0.005 0.005 ↓ 1.5 3 7,545

Index Scan using ix01f_tb_viagem on tb_viagem v (cost=0.43..2.63 rows=2 width=8) (actual time=0.004..0.005 rows=3 loops=7,545)

  • Index Cond: ((id_rd)::integer = (rd.id_rd)::integer)
13. 0.006 0.006 ↑ 4.3 3 19,530

Index Scan using ix01f_tb_trecho_viagem on tb_trecho_viagem tv (cost=0.43..0.70 rows=13 width=8) (actual time=0.004..0.006 rows=3 loops=19,530)

  • Index Cond: ((id_viagem)::integer = (v.id_viagem)::integer)
14. 0.001 0.001 ↓ 0.0 0 56,234

Index Scan using pk00_tb_geometria on tb_geometria g (cost=0.43..0.48 rows=1 width=48) (actual time=0.001..0.001 rows=0 loops=56,234)

  • Index Cond: ((id_geometria)::integer = (tv.id_local_clt)::integer)
15. 0.001 0.001 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=32) (actual time=0.001..0.001 rows=1 loops=1)