explain.depesz.com

PostgreSQL's explain analyze made readable

Result: pKf3

Settings
# exclusive inclusive rows x rows loops node
1. 0.063 5,370.220 ↓ 406.0 406 1

Group (cost=827.21..827.22 rows=1 width=8) (actual time=5,370.141..5,370.220 rows=406 loops=1)

  • Group Key: v.id_veiculo, g.id_geometria
2. 0.389 5,370.157 ↓ 406.0 406 1

Sort (cost=827.21..827.22 rows=1 width=8) (actual time=5,370.139..5,370.157 rows=406 loops=1)

  • Sort Key: v.id_veiculo, g.id_geometria
  • Sort Method: quicksort Memory: 44kB
3. 48.817 5,369.768 ↓ 406.0 406 1

Nested Loop Semi Join (cost=149.31..827.20 rows=1 width=8) (actual time=22.731..5,369.768 rows=406 loops=1)

4. 11.362 1,510.711 ↓ 13,230.0 79,380 1

Nested Loop (cost=149.31..770.76 rows=6 width=103) (actual time=0.619..1,510.711 rows=79,380 loops=1)

5. 1.209 1.209 ↓ 210.0 210 1

Index Scan using ind_tb_geometria_idcamada_valor1 on tb_geometria g (cost=0.56..476.14 rows=1 width=95) (actual time=0.051..1.209 rows=210 loops=1)

  • Index Cond: ((id_camada)::integer = 8,343)
  • Filter: ((valor1)::text ~~ '%qua%'::text)
  • Rows Removed by Filter: 441
6. 72.870 1,498.140 ↓ 63.0 378 210

Nested Loop (cost=148.75..294.55 rows=6 width=8) (actual time=0.172..7.134 rows=378 loops=210)

  • Join Filter: ((v.id_veiculo)::integer = (rd.id_veiculo)::integer)
7. 34.508 61.110 ↓ 45.1 406 210

Hash Join (cost=148.33..204.80 rows=9 width=12) (actual time=0.077..0.291 rows=406 loops=210)

  • Hash Cond: ((fv.id_veiculo)::integer = (v.id_veiculo)::integer)
8. 19.530 26.250 ↓ 1.0 779 210

Bitmap Heap Scan on tb_filial_veiculo fv (cost=9.76..64.23 rows=758 width=8) (actual time=0.044..0.125 rows=779 loops=210)

  • Recheck Cond: ((id_filial)::integer = 55)
  • Heap Blocks: exact=2,520
9. 6.720 6.720 ↓ 1.0 779 210

Bitmap Index Scan on pk00_tb_filial_veiculo (cost=0.00..9.57 rows=758 width=0) (actual time=0.032..0.032 rows=779 loops=210)

  • Index Cond: ((id_filial)::integer = 55)
10. 0.050 0.352 ↓ 3.2 406 1

Hash (cost=137.00..137.00 rows=126 width=4) (actual time=0.352..0.352 rows=406 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 23kB
11. 0.159 0.302 ↓ 3.2 406 1

Bitmap Heap Scan on tb_veiculo v (cost=34.54..137.00 rows=126 width=4) (actual time=0.153..0.302 rows=406 loops=1)

  • Recheck Cond: ((rotulos && '{207}'::integer[]) AND ((id_modelo_tipo)::integer = 23))
  • Heap Blocks: exact=78
12. 0.005 0.143 ↓ 0.0 0 1

BitmapAnd (cost=34.54..34.54 rows=126 width=0) (actual time=0.143..0.143 rows=0 loops=1)

13. 0.060 0.060 ↑ 1.0 779 1

Bitmap Index Scan on tb_veiculo_rotulos_idx (cost=0.00..9.44 rows=779 width=0) (actual time=0.060..0.060 rows=779 loops=1)

  • Index Cond: (rotulos && '{207}'::integer[])
14. 0.078 0.078 ↑ 1.0 1,667 1

Bitmap Index Scan on ix04f_tb_veiculo (cost=0.00..24.79 rows=1,667 width=0) (actual time=0.078..0.078 rows=1,667 loops=1)

  • Index Cond: ((id_modelo_tipo)::integer = 23)
15. 1,364.160 1,364.160 ↑ 1.0 1 85,260

Index Scan using ind_tb_rd_idveiculo_dtiniterm_dtfimterm on tb_rd rd (cost=0.41..9.96 rows=1 width=12) (actual time=0.015..0.016 rows=1 loops=85,260)

  • Index Cond: (((id_veiculo)::integer = (fv.id_veiculo)::integer) AND ('["2020-06-29 02:00:00-03","2020-06-30 02:00:00-03"]'::tstzrange && tstzrange(dt_inicio_terminal, dt_fim_terminal, '[]'::text)))
  • Filter: ((id_filial)::integer = 55)
16. 1,747.578 3,810.240 ↓ 0.0 0 79,380

Append (cost=0.00..9.37 rows=4 width=36) (actual time=0.048..0.048 rows=0 loops=79,380)

17. 0.000 0.000 ↓ 0.0 0 79,380

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

  • Filter: ((dt_operacao >= '2020-06-29 02:00:00-03'::timestamp with time zone) AND (dt_operacao <= '2020-06-30 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)))
18. 714.420 714.420 ↓ 0.0 0 79,380

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.009..0.009 rows=0 loops=79,380)

  • Index Cond: (((id_rd)::integer = (rd.id_rd)::integer) AND (geom && st_envelope(g.geom)))
  • Filter: ((dt_operacao >= '2020-06-29 02:00:00-03'::timestamp with time zone) AND (dt_operacao <= '2020-06-30 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
19. 1,111.320 1,111.320 ↓ 0.0 0 79,380

Index Scan using ind_tbpontoin_idrd_geom on tb_ponto_in p_2 (cost=0.41..3.16 rows=1 width=36) (actual time=0.014..0.014 rows=0 loops=79,380)

  • Index Cond: (((id_rd)::integer = (rd.id_rd)::integer) AND (geom && st_envelope(g.geom)))
  • Filter: ((dt_operacao >= '2020-06-29 02:00:00-03'::timestamp with time zone) AND (dt_operacao <= '2020-06-30 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
20. 236.922 236.922 ↓ 0.0 0 78,974

Index Scan using ind_tbpontonaorastreado_geom_dtoperacao on tb_ponto_nao_rastreado p_3 (cost=0.15..2.90 rows=1 width=36) (actual time=0.003..0.003 rows=0 loops=78,974)

  • Index Cond: ((dt_operacao >= '2020-06-29 02:00:00-03'::timestamp with time zone) AND (dt_operacao <= '2020-06-30 02:00:00-03'::timestamp with time zone))
  • Filter: (((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)))
Planning time : 2.870 ms
Execution time : 5,370.676 ms