explain.depesz.com

PostgreSQL's explain analyze made readable

Result: eQXH

Settings
# exclusive inclusive rows x rows loops node
1. 0.041 148.685 ↑ 532.3 24 1

Sort (cost=28,100.77..28,132.71 rows=12,775 width=32) (actual time=148.684..148.685 rows=24 loops=1)

  • Sort Key: (("*SELECT* 1".setor)::character varying)
  • Sort Method: quicksort Memory: 26kB
2. 0.071 148.644 ↑ 532.3 24 1

HashAggregate (cost=27,101.70..27,229.45 rows=12,775 width=32) (actual time=148.586..148.644 rows=24 loops=1)

  • Group Key: (("*SELECT* 1".setor)::character varying)
3. 0.002 148.573 ↑ 532.3 24 1

Append (cost=26,810.78..27,069.77 rows=12,775 width=32) (actual time=148.463..148.573 rows=24 loops=1)

4. 0.003 148.523 ↑ 555.4 23 1

Subquery Scan on *SELECT* 1 (cost=26,810.78..27,066.26 rows=12,774 width=32) (actual time=148.463..148.523 rows=23 loops=1)

5. 5.241 148.520 ↑ 555.4 23 1

HashAggregate (cost=26,810.78..26,938.52 rows=12,774 width=44) (actual time=148.462..148.520 rows=23 loops=1)

  • Group Key: g.nm_geometria
6. 15.329 143.279 ↑ 1.1 11,547 1

Gather (cost=1,001.73..26,778.85 rows=12,774 width=44) (actual time=0.495..143.279 rows=11,547 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
7. 33.766 127.950 ↑ 1.3 5,774 2

Nested Loop (cost=1.73..24,501.45 rows=7,514 width=44) (actual time=0.100..127.950 rows=5,774 loops=2)

8. 64.322 94.183 ↓ 3.5 26,330 2

Nested Loop (cost=1.30..20,871.08 rows=7,514 width=4) (actual time=0.088..94.183 rows=26,330 loops=2)

9. 19.777 29.854 ↓ 2.4 8,759 2

Nested Loop (cost=0.86..17,947.51 rows=3,638 width=4) (actual time=0.078..29.854 rows=8,759 loops=2)

10. 10.072 10.072 ↓ 1.2 3,451 2

Parallel Index Scan using ind_tb_rd_idfilial_dtini_idveiculo_idrd on tb_rd rd (cost=0.43..10,453.96 rows=2,811 width=4) (actual time=0.068..10.072 rows=3,451 loops=2)

  • Index Cond: (((id_filial)::integer = 47) AND (dt_inicio_terminal >= '2017-01-01 00:00:00'::timestamp without time zone) AND (dt_inicio_terminal <= '2018-01-01 23:59:00'::timestamp without time zone))
  • Filter: ((id_modelo_coleta)::integer = 1)
  • Rows Removed by Filter: 3830
11. 0.005 0.005 ↓ 1.5 3 6,902

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

  • Index Cond: ((id_rd)::integer = (rd.id_rd)::integer)
12. 0.007 0.007 ↑ 4.0 3 17,518

Index Scan using ix01f_tb_trecho_viagem on tb_trecho_viagem tv (cost=0.43..0.68 rows=12 width=8) (actual time=0.005..0.007 rows=3 loops=17,518)

  • Index Cond: ((id_viagem)::integer = (v.id_viagem)::integer)
13. 0.001 0.001 ↓ 0.0 0 52,659

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=52,659)

  • Index Cond: ((id_geometria)::integer = (tv.id_local_clt)::integer)
14. 0.002 0.048 ↑ 1.0 1 1

Limit (cost=1.30..3.49 rows=1 width=32) (actual time=0.048..0.048 rows=1 loops=1)

15. 0.001 0.046 ↑ 12,774.0 1 1

Nested Loop (cost=1.30..28,045.20 rows=12,774 width=32) (actual time=0.046..0.046 rows=1 loops=1)

16. 0.001 0.035 ↑ 6,184.0 1 1

Nested Loop (cost=0.86..23,268.34 rows=6,184 width=4) (actual time=0.035..0.035 rows=1 loops=1)

17. 0.028 0.028 ↑ 4,778.0 1 1

Index Scan using ind_tb_rd_idfilial_dtini_idveiculo_idrd on tb_rd rd_1 (cost=0.43..10,531.17 rows=4,778 width=4) (actual time=0.028..0.028 rows=1 loops=1)

  • Index Cond: (((id_filial)::integer = 47) AND (dt_inicio_terminal >= '2017-01-01 00:00:00'::timestamp without time zone) AND (dt_inicio_terminal <= '2018-01-01 23:59:00'::timestamp without time zone))
  • Filter: ((id_modelo_coleta)::integer = 1)
  • Rows Removed by Filter: 2
18. 0.006 0.006 ↑ 2.0 1 1

Index Scan using ix01f_tb_viagem on tb_viagem v_1 (cost=0.43..2.65 rows=2 width=8) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: ((id_rd)::integer = (rd_1.id_rd)::integer)
19. 0.010 0.010 ↑ 12.0 1 1

Index Only Scan using ix01f_tb_trecho_viagem on tb_trecho_viagem tv_1 (cost=0.43..0.65 rows=12 width=4) (actual time=0.010..0.010 rows=1 loops=1)

  • Index Cond: (id_viagem = (v_1.id_viagem)::integer)
  • Heap Fetches: 0