explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RbWe : Optimization for: Optimization for: plan #qAv; plan #t78

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.177 2.188 ↑ 2.8 836 1

Sort (cost=908.27..914.02 rows=2,301 width=43) (actual time=2.145..2.188 rows=836 loops=1)

  • Sort Key: ((((etc.etc_codigo)::text || ' - '::text) || (ex.exa_nome)::text))
  • Sort Method: quicksort Memory: 142kB
2. 0.574 2.011 ↑ 2.8 836 1

Nested Loop (cost=1.85..779.78 rows=2,301 width=43) (actual time=0.042..2.011 rows=836 loops=1)

3. 0.055 0.601 ↑ 2.8 836 1

Nested Loop (cost=1.56..26.77 rows=2,301 width=17) (actual time=0.034..0.601 rows=836 loops=1)

4. 0.005 0.021 ↑ 1.0 1 1

Nested Loop (cost=1.14..18.09 rows=1 width=17) (actual time=0.020..0.021 rows=1 loops=1)

5. 0.001 0.011 ↑ 1.0 1 1

Nested Loop (cost=0.85..17.74 rows=1 width=16) (actual time=0.011..0.011 rows=1 loops=1)

6. 0.006 0.006 ↑ 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.006..0.006 rows=1 loops=1)

  • Index Cond: (id = 311311)
7. 0.004 0.004 ↑ 2.0 1 1

Index Scan using idx_ate_atendimento_detalhe_id_atendimento on ate_atendimento_detalhe da (cost=0.42..9.28 rows=2 width=24) (actual time=0.004..0.004 rows=1 loops=1)

  • Index Cond: (id_atendimento = fa.id_atendimento)
  • Filter: ((id_material IS NULL) AND (etc_id IS NOT NULL))
8. 0.005 0.005 ↑ 1.0 1 1

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

  • Index Cond: (etc_id = (da.etc_id)::numeric)
9. 0.525 0.525 ↓ 2.8 836 1

Index Only Scan using idx_exame_exame_atendimento on exame_atendimento ea (cost=0.42..5.71 rows=297 width=8) (actual time=0.011..0.525 rows=836 loops=1)

  • Index Cond: (exa_id = da.id_exame)
  • Heap Fetches: 836
10. 0.836 0.836 ↑ 1.0 1 836

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

  • Index Cond: (exa_id = (ea.exa_id)::numeric)