explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 37XW : SEC

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Sort (cost=3,764,255.87..3,766,529.89 rows=909,607 width=142) (actual rows= loops=)

  • Sort Key: empresa.cnpj
2. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=2,063,305.93..3,608,935.55 rows=909,607 width=142) (actual rows= loops=)

  • Hash Cond: (empresa.motivositcadastral_id = sitcadastral.id)
3. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on empresa (cost=2,063,303.40..3,606,467.00 rows=909,607 width=98) (actual rows= loops=)

  • Recheck Cond: ((municipio)::text = 'SAO PAULO'::text)
  • Filter: (((situacaocadastral)::text = '02'::text) AND (((cnaefiscal_id)::text = '4721102'::text) OR (hashed SubPlan 1)))
4. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on empresa_municipio_e91a5f0f_like (cost=0.00..85,300.04 rows=3,823,930 width=0) (actual rows= loops=)

  • Index Cond: ((municipio)::text = 'SAO PAULO'::text)
5.          

SubPlan (for Bitmap Heap Scan)

6. 0.000 0.000 ↓ 0.0

Gather (cost=9,744.32..1,977,728.48 rows=18,990 width=15) (actual rows= loops=)

  • Workers Planned: 2
7. 0.000 0.000 ↓ 0.0

Nested Loop (cost=8,744.32..1,974,829.48 rows=7,912 width=15) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Parallel Bitmap Heap Scan on cnaesec u0 (cost=8,743.75..501,088.65 rows=191,648 width=19) (actual rows= loops=)

  • Recheck Cond: (((cnaesec_id)::text = '4721102'::text) OR ((codigo)::text = '4721102'::text))
9. 0.000 0.000 ↓ 0.0

BitmapOr (cost=8,743.75..8,743.75 rows=460,885 width=0) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on cnaesec_cnaesec_id_c8919709 (cost=0.00..4,256.89 rows=230,443 width=0) (actual rows= loops=)

  • Index Cond: ((cnaesec_id)::text = '4721102'::text)
11. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on cnaesec_codigo_1934848a (cost=0.00..4,256.89 rows=230,443 width=0) (actual rows= loops=)

  • Index Cond: ((codigo)::text = '4721102'::text)
12. 0.000 0.000 ↓ 0.0

Index Scan using empresa_pkey on empresa u1 (cost=0.56..7.69 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = u0.empresa_id)
  • Filter: (((municipio)::text = 'SAO PAULO'::text) AND ((situacaocadastral)::text = '02'::text))
13. 0.000 0.000 ↓ 0.0

Hash (cost=1.68..1.68 rows=68 width=44) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Seq Scan on sitcadastral (cost=0.00..1.68 rows=68 width=44) (actual rows= loops=)