explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BZpj

Settings
# exclusive inclusive rows x rows loops node
1. 0.584 108.245 ↑ 1.0 1 1

Aggregate (cost=58,545.11..58,545.12 rows=1 width=16) (actual time=108.245..108.245 rows=1 loops=1)

2. 92.703 92.703 ↓ 47.9 2,493 1

Index Scan using icontrato1 on contrato c (cost=0.43..57,792.84 rows=52 width=8) (actual time=45.325..92.703 rows=2,493 loops=1)

  • Index Cond: (procod = 28)
  • Filter: ((condatcad >= '2019-09-10'::date) AND (condatcad <= '2019-10-30'::date) AND (conati = 0))
  • Rows Removed by Filter: 63,789
3.          

SubPlan (for Aggregate)

4. 1.677 14.958 ↑ 3.0 1 2,493

Nested Loop (cost=0.86..41.66 rows=3 width=0) (actual time=0.006..0.006 rows=1 loops=2,493)

5. 4.986 4.986 ↑ 4.3 3 2,493

Index Scan using contrato_parcela_iu0021 on contrato_parcela cp (cost=0.43..4.51 rows=13 width=8) (actual time=0.002..0.002 rows=3 loops=2,493)

  • Index Cond: (concod = c.concod)
6. 8.295 8.295 ↓ 0.0 0 8,295

Index Only Scan using contrato_parcela_retoma_iu0011 on contrato_parcela_retomada cpm (cost=0.43..2.84 rows=2 width=8) (actual time=0.001..0.001 rows=0 loops=8,295)

  • Index Cond: (conparseq = cp.conparseq)
  • Heap Fetches: 1,995
7. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=298,119.68..390,926.00 rows=1,190,511 width=8) (never executed)

  • Hash Cond: (cpm_1.conparseq = cp_1.conparseq)
8. 0.000 0.000 ↓ 0.0 0

Seq Scan on contrato_parcela_retomada cpm_1 (cost=0.00..40,286.11 rows=1,190,511 width=8) (never executed)

9. 0.000 0.000 ↓ 0.0 0

Hash (cost=197,771.86..197,771.86 rows=5,772,786 width=16) (never executed)

10. 0.000 0.000 ↓ 0.0 0

Seq Scan on contrato_parcela cp_1 (cost=0.00..197,771.86 rows=5,772,786 width=16) (never executed)

Planning time : 1.776 ms
Execution time : 108.388 ms