explain.depesz.com

PostgreSQL's explain analyze made readable

Result: AlvP : Optimization for: plan #vcVG

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 75,892.979 75,907.719 ↓ 6.0 670 1

Index Scan using tb_dist_certificate_id_contract_cd_account_idx on tb_dist_certificate dc (cost=0.43..800.56 rows=112 width=44) (actual time=111.792..75,907.719 rows=670 loops=1)

  • Index Cond: ((id_contract = 8) AND (cd_account = 980,227))
  • Filter: (qtd_quotes > '0'::numeric)
2.          

SubPlan (for Index Scan)

3. 0.000 14.740 ↑ 1.0 1 670

Index Scan using tb_dist_certificate_daily_pk on tb_dist_certificate_daily tb_dist_certificate_daily_1 (cost=2.40..4.43 rows=1 width=32) (actual time=0.022..0.022 rows=1 loops=670)

  • Index Cond: ((id_customer = dc.id_customer) AND (id_instrument = dc.id_instrument) AND (id_contract = dc.id_contract) AND (id_certificate = dc.id_certificate) AND (dt_reference = $4))
4.          

Initplan (for Index Scan)

5. 75,876.160 75,876.160 ↑ 1.0 1 670

Aggregate (cost=1.82..1.83 rows=1 width=4) (actual time=113.248..113.248 rows=1 loops=670)

  • -> Index Only Scan using tb_dist_certificate_daily_pk on tb_dist_certificate_daily (cost=0.57..1.79 rows=10 width=4) (actual time=0.013..90.776 rows=430,140loops=670)
  • Index Cond: ((id_customer = dc.id_customer) AND (id_instrument = dc.id_instrument) AND (id_contract = dc.id_contract))
  • Heap Fetches: 3,400,920
Planning time : 0.561 ms
Execution time : 75,908.371 ms