explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mG2e

Settings
# exclusive inclusive rows x rows loops node
1. 0.012 41.224 ↑ 1.0 1 1

Limit (cost=1.42..419.23 rows=1 width=116) (actual time=41.214..41.224 rows=1 loops=1)

2. 0.015 41.212 ↑ 335,875.0 1 1

Nested Loop (cost=1.42..140,332,044.17 rows=335,875 width=116) (actual time=41.212..41.212 rows=1 loops=1)

3. 0.004 24.348 ↑ 335,875.0 1 1

Nested Loop (cost=1.00..11,119,726.83 rows=335,875 width=104) (actual time=24.348..24.348 rows=1 loops=1)

4. 0.008 21.121 ↑ 632,192.0 1 1

Nested Loop (cost=0.58..8,416,043.74 rows=632,192 width=100) (actual time=21.121..21.121 rows=1 loops=1)

5. 0.987 0.987 ↑ 907,907.0 1 1

Seq Scan on loan l (cost=0.00..984,191.73 rows=907,907 width=65) (actual time=0.986..0.987 rows=1 loops=1)

  • Filter: ((product = 'balancecredit'::text) AND (now() <@ (asserted)::tstzrange) AND (now() <@ (effective)::tstzrange) AND (now() <@ (asserted)::tstzrange) AND (now() <@ (effective)::tstzrange))
6. 20.126 20.126 ↑ 1.0 1 1

Index Scan using loan_status_archive_loan_id_date on loan_status_archive lsa (cost=0.58..8.19 rows=1 width=35) (actual time=20.126..20.126 rows=1 loops=1)

  • Index Cond: ((loan_id = l.loan_pro_loan_id) AND (date = (timezone('CDT'::text, CURRENT_TIMESTAMP))::date))
7. 3.223 3.223 ↑ 1.0 1 1

Index Only Scan using loan_setup_entity_loan_id on loan_setup_entity lse (cost=0.42..4.28 rows=1 width=4) (actual time=3.222..3.223 rows=1 loops=1)

  • Index Cond: (loan_id = l.loan_pro_loan_id)
  • Heap Fetches: 0
8. 0.653 0.653 ↑ 1.0 1 1

Index Scan using loan_settings_entity_loan_id on loan_settings_entity lste (cost=0.42..7.81 rows=1 width=16) (actual time=0.652..0.653 rows=1 loops=1)

  • Index Cond: (loan_id = lse.loan_id)
9.          

SubPlan (for Nested Loop)

10. 0.013 16.196 ↑ 1.0 1 1

Aggregate (cost=376.86..376.87 rows=1 width=32) (actual time=16.195..16.196 rows=1 loops=1)

11. 16.183 16.183 ↑ 6.0 1 1

Index Scan using loan_tx_entity_id1 on loan_tx tx (cost=0.43..376.84 rows=6 width=3) (actual time=16.180..16.183 rows=1 loops=1)

  • Index Cond: (entity_id = lsa.loan_id)
  • Filter: ((period = 0) AND (mod_id = 0) AND (type = 'scheduledPayment'::bpchar))
  • Rows Removed by Filter: 29