explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Hu4q

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.009 271.574 ↑ 1.0 1 1

Sort (cost=35,271.23..35,271.23 rows=1 width=43) (actual time=271.574..271.574 rows=1 loops=1)

  • Sort Key: ex.exa_nome
  • Sort Method: quicksort Memory: 25kB
2. 0.015 271.565 ↑ 1.0 1 1

Nested Loop (cost=11,143.14..35,271.22 rows=1 width=43) (actual time=174.411..271.565 rows=1 loops=1)

3. 131.557 271.541 ↑ 1.0 1 1

Hash Join (cost=11,142.84..35,270.87 rows=1 width=42) (actual time=174.387..271.541 rows=1 loops=1)

  • Hash Cond: (((da.id_atendimento)::numeric = a.ate_id) AND ((da.id_exame)::numeric = ex.exa_id))
4. 60.518 60.518 ↓ 1.0 407,077 1

Seq Scan on ate_atendimento_detalhe da (cost=0.00..20,065.91 rows=406,211 width=24) (actual time=0.006..60.518 rows=407,077 loops=1)

  • Filter: (id_material IS NULL)
  • Rows Removed by Filter: 215885
5. 0.006 79.466 ↑ 1.0 1 1

Hash (cost=11,142.83..11,142.83 rows=1 width=69) (actual time=79.466..79.466 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
6. 0.011 79.460 ↑ 1.0 1 1

Nested Loop (cost=17.19..11,142.83 rows=1 width=69) (actual time=49.249..79.460 rows=1 loops=1)

7. 55.395 79.440 ↑ 1.0 1 1

Hash Join (cost=16.91..11,142.50 rows=1 width=30) (actual time=49.230..79.440 rows=1 loops=1)

  • Hash Cond: ((ea.ate_id)::numeric = a.ate_id)
8. 24.020 24.020 ↓ 1.0 404,922 1

Seq Scan on exame_atendimento ea (cost=0.00..9,101.06 rows=404,906 width=16) (actual time=0.003..24.020 rows=404,922 loops=1)

9. 0.004 0.025 ↑ 1.0 1 1

Hash (cost=16.89..16.89 rows=1 width=14) (actual time=0.025..0.025 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
10. 0.004 0.021 ↑ 1.0 1 1

Nested Loop (cost=0.85..16.89 rows=1 width=14) (actual time=0.020..0.021 rows=1 loops=1)

11. 0.009 0.009 ↑ 1.0 1 1

Index Scan using pk_fatura on fat_fatura fa (cost=0.42..8.44 rows=1 width=8) (actual time=0.009..0.009 rows=1 loops=1)

  • Index Cond: (id = 311311)
12. 0.008 0.008 ↑ 1.0 1 1

Index Only Scan using pk_atendimento on atendimento a (cost=0.42..8.44 rows=1 width=6) (actual time=0.007..0.008 rows=1 loops=1)

  • Index Cond: (ate_id = (fa.id_atendimento)::numeric)
  • Heap Fetches: 1
13. 0.009 0.009 ↑ 1.0 1 1

Index Scan using pk_exame on exame ex (cost=0.29..0.31 rows=1 width=39) (actual time=0.008..0.009 rows=1 loops=1)

  • Index Cond: (exa_id = (ea.exa_id)::numeric)
14. 0.009 0.009 ↑ 1.0 1 1

Index Scan using pk_estrutura_tabela_cobranca on estrutura_tabela_cobranca etc (cost=0.29..0.33 rows=1 width=15) (actual time=0.009..0.009 rows=1 loops=1)

  • Index Cond: (etc_id = (da.etc_id)::numeric)