explain.depesz.com

PostgreSQL's explain analyze made readable

Result: fK5J

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

Limit (cost=71,899.72..71,899.72 rows=1 width=12) (actual time=171.584..171.584 rows=0 loops=1)

2. 0.021 171.583 ↓ 0.0 0 1

Sort (cost=71,899.72..72,011.28 rows=44,622 width=12) (actual time=171.583..171.583 rows=0 loops=1)

  • Sort Key: "*SELECT* 1".priority DESC, "*SELECT* 1".fail_counter, "*SELECT* 1".id
  • Sort Method: quicksort Memory: 25kB
3. 0.001 171.562 ↓ 0.0 0 1

Append (cost=0.57..71,676.61 rows=44,622 width=12) (actual time=171.562..171.562 rows=0 loops=1)

4. 0.001 119.468 ↓ 0.0 0 1

Subquery Scan on *SELECT* 1 (cost=0.57..1,602.72 rows=22,288 width=12) (actual time=119.468..119.468 rows=0 loops=1)

5. 119.467 119.467 ↓ 0.0 0 1

Index Scan using billing_document_status_idx1 on billing_document billing_document_1 (cost=0.57..1,379.84 rows=22,288 width=12) (actual time=119.467..119.467 rows=0 loops=1)

  • Index Cond: ((status)::text = 'pending'::text)
  • Filter: ((parent_id IS NULL) AND (fail_counter <= 10) AND ((document_type)::text = ANY ('{invoice_payment,invoice_payment_cancel,subaccount_charge_off,subscription_debit_units,subscription_charge_off,subscription_credit_units,withdraw_credited_units,cross_company_transfer,services_transfer,debt_clearance,cross_subscription_transfer,cancel_subscription_debit_units,withdraw_credited_amount,subscription_charge_off_cancel,cross_subscription_transfer_back,subscription_uncharge_off_transfer}'::text[])))
  • Rows Removed by Filter: 13,570
6. 0.002 52.093 ↓ 0.0 0 1

Subquery Scan on *SELECT* 2 (cost=1.14..70,073.89 rows=22,334 width=12) (actual time=52.093..52.093 rows=0 loops=1)

7. 0.001 52.091 ↓ 0.0 0 1

Nested Loop (cost=1.14..69,850.55 rows=22,334 width=12) (actual time=52.091..52.091 rows=0 loops=1)

8. 52.090 52.090 ↓ 0.0 0 1

Index Scan using billing_document_status_idx1 on billing_document billing_document_2 (cost=0.57..1,379.84 rows=22,338 width=16) (actual time=52.090..52.090 rows=0 loops=1)

  • Index Cond: ((status)::text = 'pending'::text)
  • Filter: ((fail_counter <= 10) AND ((document_type)::text = ANY ('{invoice_payment,invoice_payment_cancel,subaccount_charge_off,subscription_debit_units,subscription_charge_off,subscription_credit_units,withdraw_credited_units,cross_company_transfer,services_transfer,debt_clearance,cross_subscription_transfer,cancel_subscription_debit_units,withdraw_credited_amount,subscription_charge_off_cancel,cross_subscription_transfer_back,subscription_uncharge_off_transfer}'::text[])))
  • Rows Removed by Filter: 13,570
9. 0.000 0.000 ↓ 0.0 0

Index Scan using billing_document_pkey on billing_document billing_document_3 (cost=0.57..3.06 rows=1 width=4) (never executed)

  • Index Cond: (id = billing_document_2.parent_id)
  • Filter: ((status)::text = 'processed'::text)