explain.depesz.com

PostgreSQL's explain analyze made readable

Result: s2tD

Settings
# exclusive inclusive rows x rows loops node
1. 61,712.247 61,717.056 ↓ 5.4 687 1

Index Scan using tb_dist_certificate_id_contract_cd_account_idx on tb_dist_certificate dc (cost=0.43..1,041.67 rows=128 width=44) (actual time=254.068..61,717.056 rows=687 loops=1)

  • Index Cond: ((id_contract = 8) AND (cd_account = 979,849))
  • Filter: (qtd_quotes > '0'::numeric)
  • Rows Removed by Filter: 2
2.          

SubPlan (for Index Scan)

3. 0.000 4.809 ↑ 1.0 1 687

Index Scan using tb_dist_certificate_daily_pk on tb_dist_certificate_daily tb_dist_certificate_daily_1 (cost=3.39..5.43 rows=1 width=32) (actual time=0.007..0.007 rows=1 loops=687)

  • 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. 11,681.748 61,708.401 ↑ 1.0 1 687

Aggregate (cost=2.82..2.83 rows=1 width=4) (actual time=89.823..89.823 rows=1 loops=687)

6. 50,026.653 50,026.653 ↓ 43,701.7 437,017 687

Index Only Scan using tb_dist_certificate_daily_pk on tb_dist_certificate_daily (cost=0.57..2.79 rows=10 width=4) (actual time=0.010..72.819 rows=437,017 loops=687)

  • Index Cond: ((id_customer = dc.id_customer) AND (id_instrument = dc.id_instrument) AND (id_contract = dc.id_contract))
  • Heap Fetches: 6,791,682
Planning time : 0.551 ms
Execution time : 61,717.239 ms