explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3gJH : Optimization for: plan #xbAq

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 3.011 ↓ 0.0 0 1

Limit (cost=0.29..35.51 rows=1 width=99) (actual time=3.011..3.011 rows=0 loops=1)

2. 0.019 3.010 ↓ 0.0 0 1

Nested Loop (cost=0.29..2,501.02 rows=71 width=99) (actual time=3.010..3.010 rows=0 loops=1)

3. 2.869 2.869 ↑ 4.7 61 1

Seq Scan on billing_agreement "bi.BillingAgreement" (cost=0.00..657.98 rows=288 width=95) (actual time=2.744..2.869 rows=61 loops=1)

  • Filter: ((processing_lock_datetime IS NULL) AND (billing_agreement_status_id = 5) AND (start_datetime <= now()) AND ((termination_datetime > now()) OR (termination_datetime IS NULL)))
  • Rows Removed by Filter: 16793
4. 0.122 0.122 ↓ 0.0 0 61

Index Scan using billing_instance_billing_agreement_id_billing_period_idx on billing_instance bi (cost=0.29..6.39 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=61)

  • Index Cond: ((billing_agreement_id = "bi.BillingAgreement".billing_agreement_id) AND (billing_period = 1))
  • Filter: ((billing_instance_status_id = 1) AND (scheduled_billing_datetime <= now()))
  • Rows Removed by Filter: 1