explain.depesz.com

PostgreSQL's explain analyze made readable

Result: rwnT

Settings
# exclusive inclusive rows x rows loops node
1. 0.164 38,996.101 ↓ 618.0 618 1

Group (cost=859.75..859.76 rows=1 width=8) (actual time=38,995.895..38,996.101 rows=618 loops=1)

  • Group Key: v.id_veiculo, g.id_geometria
2. 1.030 38,995.937 ↓ 618.0 618 1

Sort (cost=859.75..859.75 rows=1 width=8) (actual time=38,995.893..38,995.937 rows=618 loops=1)

  • Sort Key: v.id_veiculo, g.id_geometria
  • Sort Method: quicksort Memory: 53kB
3. 75.741 38,994.907 ↓ 618.0 618 1

Nested Loop Semi Join (cost=153.45..859.74 rows=1 width=8) (actual time=414.205..38,994.907 rows=618 loops=1)

4. 15.256 4,042.120 ↓ 11,842.8 59,214 1

Nested Loop (cost=153.45..813.32 rows=5 width=107) (actual time=61.874..4,042.120 rows=59,214 loops=1)

5. 12.453 12.453 ↓ 213.0 213 1

Index Scan using ind_tb_geometria_idcamada_valor1 on tb_geometria g (cost=0.56..525.61 rows=1 width=99) (actual time=7.559..12.453 rows=213 loops=1)

  • Index Cond: ((id_camada)::integer = 9,994)
  • Filter: ((valor1)::text ~~ '%qui%'::text)
  • Rows Removed by Filter: 441
6. 26.199 4,014.411 ↓ 55.6 278 213

Nested Loop (cost=152.89..287.66 rows=5 width=8) (actual time=0.471..18.847 rows=278 loops=213)

  • Join Filter: ((v.id_veiculo)::integer = (rd.id_veiculo)::integer)
7. 79.859 183.180 ↓ 40.6 406 213

Hash Join (cost=152.48..199.73 rows=10 width=12) (actual time=0.318..0.860 rows=406 loops=213)

  • Hash Cond: ((fv.id_veiculo)::integer = (v.id_veiculo)::integer)
8. 50.481 50.481 ↑ 1.0 813 213

Index Only Scan using pk00_tb_filial_veiculo on tb_filial_veiculo fv (cost=0.29..45.36 rows=831 width=8) (actual time=0.010..0.237 rows=813 loops=213)

  • Index Cond: (id_filial = 55)
  • Heap Fetches: 7,242
9. 0.059 52.840 ↓ 3.1 406 1

Hash (cost=150.57..150.57 rows=130 width=4) (actual time=52.840..52.840 rows=406 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 23kB
10. 0.186 52.781 ↓ 3.1 406 1

Bitmap Heap Scan on tb_veiculo v (cost=41.04..150.57 rows=130 width=4) (actual time=52.613..52.781 rows=406 loops=1)

  • Recheck Cond: ((rotulos && '{207}'::integer[]) AND ((id_modelo_tipo)::integer = 23))
  • Heap Blocks: exact=94
11. 0.009 52.595 ↓ 0.0 0 1

BitmapAnd (cost=41.04..41.04 rows=130 width=0) (actual time=52.595..52.595 rows=0 loops=1)

12. 2.535 2.535 ↑ 1.0 813 1

Bitmap Index Scan on tb_veiculo_rotulos_idx (cost=0.00..9.70 rows=813 width=0) (actual time=2.535..2.535 rows=813 loops=1)

  • Index Cond: (rotulos && '{207}'::integer[])
13. 50.051 50.051 ↓ 1.0 1,705 1

Bitmap Index Scan on ix04f_tb_veiculo (cost=0.00..31.03 rows=1,699 width=0) (actual time=50.051..50.051 rows=1,705 loops=1)

  • Index Cond: ((id_modelo_tipo)::integer = 23)
14. 3,805.032 3,805.032 ↑ 1.0 1 86,478

Index Scan using ind_tb_rd_idveiculo_dtiniterm_dtfimterm on tb_rd rd (cost=0.41..8.78 rows=1 width=12) (actual time=0.040..0.044 rows=1 loops=86,478)

  • Index Cond: (((id_veiculo)::integer = (fv.id_veiculo)::integer) AND ('["2020-10-01 02:00:00-03","2020-10-02 02:00:00-03"]'::tstzrange && tstzrange(dt_inicio_terminal, dt_fim_terminal, '[]'::text)))
  • Filter: ((id_filial)::integer = 55)
15. 3,713.748 34,877.046 ↓ 0.0 0 59,214

Append (cost=0.00..9.24 rows=4 width=36) (actual time=0.589..0.589 rows=0 loops=59,214)

16. 0.000 0.000 ↓ 0.0 0 59,214

Seq Scan on tb_ponto p (cost=0.00..0.00 rows=1 width=36) (actual time=0.000..0.000 rows=0 loops=59,214)

  • Filter: ((dt_operacao >= '2020-10-01 02:00:00-03'::timestamp with time zone) AND (dt_operacao <= '2020-10-02 02:00:00-03'::timestamp with time zone) AND ((rd.id_rd)::integer = (id_rd)::integer) AND (geom && st_envelope(g.geom)) AND (st_distance(geom, g.geom) <= '0.0005'::double precision) AND _st_intersects(geom, st_envelope(g.geom)))
17. 4,677.906 4,677.906 ↓ 0.0 0 59,214

Index Scan using ind_tbpontocrn_idrd_geom on tb_ponto_clust_recent p_1 (cost=0.56..3.30 rows=1 width=36) (actual time=0.079..0.079 rows=0 loops=59,214)

  • Index Cond: (((id_rd)::integer = (rd.id_rd)::integer) AND (geom && st_envelope(g.geom)))
  • Filter: ((dt_operacao >= '2020-10-01 02:00:00-03'::timestamp with time zone) AND (dt_operacao <= '2020-10-02 02:00:00-03'::timestamp with time zone) AND (st_distance(geom, g.geom) <= '0.0005'::double precision) AND _st_intersects(geom, st_envelope(g.geom)))
  • Rows Removed by Filter: 0
18. 234.384 234.384 ↓ 0.0 0 58,596

Index Scan using ind_tbpontoin_idrd_geom on tb_ponto_in p_2 (cost=0.29..3.03 rows=1 width=36) (actual time=0.004..0.004 rows=0 loops=58,596)

  • Index Cond: (((id_rd)::integer = (rd.id_rd)::integer) AND (geom && st_envelope(g.geom)))
  • Filter: ((dt_operacao >= '2020-10-01 02:00:00-03'::timestamp with time zone) AND (dt_operacao <= '2020-10-02 02:00:00-03'::timestamp with time zone) AND (st_distance(geom, g.geom) <= '0.0005'::double precision) AND _st_intersects(geom, st_envelope(g.geom)))
19. 26,251.008 26,251.008 ↓ 0.0 0 58,596

Index Scan using ind_tbpontonaorastreado_idrd_geom on tb_ponto_nao_rastreado p_3 (cost=0.15..2.89 rows=1 width=36) (actual time=0.448..0.448 rows=0 loops=58,596)

  • Index Cond: (geom && st_envelope(g.geom))
  • Filter: ((dt_operacao >= '2020-10-01 02:00:00-03'::timestamp with time zone) AND (dt_operacao <= '2020-10-02 02:00:00-03'::timestamp with time zone) AND ((rd.id_rd)::integer = (id_rd)::integer) AND (st_distance(geom, g.geom) <= '0.0005'::double precision) AND _st_intersects(geom, st_envelope(g.geom)))
  • Rows Removed by Filter: 44
Planning time : 17.450 ms
Execution time : 38,996.803 ms