explain.depesz.com

PostgreSQL's explain analyze made readable

Result: MLCh

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 3,939.486 ↓ 0.0 0 1

Limit (cost=319,733.32..319,733.37 rows=20 width=1,130) (actual time=3,939.486..3,939.486 rows=0 loops=1)

2. 0.006 3,939.486 ↓ 0.0 0 1

Sort (cost=319,733.32..319,737.08 rows=1,502 width=1,130) (actual time=3,939.486..3,939.486 rows=0 loops=1)

  • Sort Key: this_.fantasia
  • Sort Method: quicksort Memory: 25kB
3. 0.001 3,939.480 ↓ 0.0 0 1

Nested Loop Left Join (cost=154,259.31..319,693.35 rows=1,502 width=1,130) (actual time=3,939.480..3,939.480 rows=0 loops=1)

4. 584.265 3,939.479 ↓ 0.0 0 1

Hash Join (cost=154,259.31..309,050.43 rows=1,502 width=1,045) (actual time=3,939.479..3,939.479 rows=0 loops=1)

  • Hash Cond: (atividades5_.atividades_secundarias_id = cnae_secun2_.id)
  • Join Filter: (((cnae_secun2_.desc_subclasse)::text = 'Banco Central'::text) OR ((cnae_princ1_.desc_subclasse)::text = 'Banco Central'::text))
  • Rows Removed by Join Filter: 1024267
5. 585.036 3,354.224 ↓ 1.0 1,024,267 1

Hash Join (cost=154,175.41..290,249.92 rows=998,219 width=760) (actual time=831.270..3,354.224 rows=1,024,267 loops=1)

  • Hash Cond: (this_.atividade_principal_id = cnae_princ1_.id)
6. 743.313 2,768.832 ↑ 1.0 1,024,270 1

Merge Join (cost=154,091.51..276,342.82 rows=1,024,270 width=467) (actual time=830.899..2,768.832 rows=1,024,270 loops=1)

  • Merge Cond: (this_.id = atividades5_.business_id)
7. 711.088 711.088 ↑ 1.0 1,753,449 1

Index Scan using idx_business_id on business this_ (cost=0.00..103,203.30 rows=1,753,681 width=451) (actual time=0.008..711.088 rows=1,753,449 loops=1)

8. 176.735 1,314.431 ↑ 1.0 1,024,270 1

Materialize (cost=153,596.42..158,717.77 rows=1,024,270 width=16) (actual time=830.884..1,314.431 rows=1,024,270 loops=1)

9. 1,003.862 1,137.696 ↑ 1.0 1,024,270 1

Sort (cost=153,596.42..156,157.09 rows=1,024,270 width=16) (actual time=830.881..1,137.696 rows=1,024,270 loops=1)

  • Sort Key: atividades5_.business_id
  • Sort Method: external merge Disk: 26016kB
10. 133.834 133.834 ↑ 1.0 1,024,270 1

Seq Scan on business_cnae atividades5_ (cost=0.00..16,328.70 rows=1,024,270 width=16) (actual time=0.044..133.834 rows=1,024,270 loops=1)

11. 0.237 0.356 ↑ 1.0 1,329 1

Hash (cost=67.29..67.29 rows=1,329 width=293) (actual time=0.356..0.356 rows=1,329 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 426kB
12. 0.119 0.119 ↑ 1.0 1,329 1

Seq Scan on cnae cnae_princ1_ (cost=0.00..67.29 rows=1,329 width=293) (actual time=0.001..0.119 rows=1,329 loops=1)

13. 0.532 0.990 ↑ 1.0 1,329 1

Hash (cost=67.29..67.29 rows=1,329 width=293) (actual time=0.990..0.990 rows=1,329 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 426kB
14. 0.458 0.458 ↑ 1.0 1,329 1

Seq Scan on cnae cnae_secun2_ (cost=0.00..67.29 rows=1,329 width=293) (actual time=0.022..0.458 rows=1,329 loops=1)

15. 0.000 0.000 ↓ 0.0 0

Index Scan using address_pkey on address addressent7_ (cost=0.00..7.08 rows=1 width=85) (never executed)

  • Index Cond: (this_.endereco_id = id)