explain.depesz.com

PostgreSQL's explain analyze made readable

Result: MGB3

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.354 5,398.880 ↑ 57.3 336 1

Hash Left Join (cost=17,760.05..869,664.81 rows=19,241 width=105) (actual time=3,394.232..5,398.880 rows=336 loops=1)

  • Hash Cond: ("Servico".fk_cliente = "Servico.Cliente".codigo)
2. 0.489 5,398.482 ↑ 57.3 336 1

Hash Join (cost=17,756.86..869,607.07 rows=19,241 width=70) (actual time=3,394.161..5,398.482 rows=336 loops=1)

  • Hash Cond: ("Remessa".fk_servico = "Servico".codigo)
3. 2,367.463 5,397.530 ↑ 57.8 336 1

Bitmap Heap Scan on "Remessa" (cost=17,611.27..869,409.42 rows=19,431 width=49) (actual time=3,393.679..5,397.530 rows=336 loops=1)

  • Recheck Cond: ((fk_situacao_remessa = ANY ('{20,7,18,32}'::integer[])) AND (fk_tipo_remessa = ANY ('{1,3,4}'::integer[])) AND (data_cadastro >= '2020-01-01 00:00:00-03'::timestamp with time zone) AND (data_cadastro <= '2020-01-31 23:59:00-03'::timestamp with time zone))
  • Filter: (fk_cliente = 2)
  • Rows Removed by Filter: 385855
  • Heap Blocks: exact=167404
4. 3,030.067 3,030.067 ↑ 1.0 389,948 1

Bitmap Index Scan on idx_remessa_situacao_tipo_remessa_data_cadastro (cost=0.00..17,606.41 rows=404,243 width=0) (actual time=3,030.067..3,030.067 rows=389,948 loops=1)

  • Index Cond: ((fk_situacao_remessa = ANY ('{20,7,18,32}'::integer[])) AND (fk_tipo_remessa = ANY ('{1,3,4}'::integer[])) AND (data_cadastro >= '2020-01-01 00:00:00-03'::timestamp with time zone) AND (data_cadastro <= '2020-01-31 23:59:00-03'::timestamp with time zone))
5. 0.045 0.463 ↑ 1.0 203 1

Hash (cost=143.05..143.05 rows=203 width=29) (actual time=0.463..0.463 rows=203 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 21kB
6. 0.418 0.418 ↑ 1.0 203 1

Seq Scan on "Servico" (cost=0.00..143.05 rows=203 width=29) (actual time=0.007..0.418 rows=203 loops=1)

  • Filter: (show_dashboard IS NOT FALSE)
  • Rows Removed by Filter: 2
7. 0.020 0.044 ↑ 1.0 53 1

Hash (cost=2.53..2.53 rows=53 width=39) (actual time=0.044..0.044 rows=53 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
8. 0.024 0.024 ↑ 1.0 53 1

Seq Scan on "Cliente" "Servico.Cliente" (cost=0.00..2.53 rows=53 width=39) (actual time=0.009..0.024 rows=53 loops=1)