explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Wbvn

Settings
# exclusive inclusive rows x rows loops node
1. 13,578.536 126,472.727 ↓ 29.5 5,253,506 1

GroupAggregate (cost=5,179,116.81..5,198,717.16 rows=178,185 width=382) (actual time=111,757.457..126,472.727 rows=5,253,506 loops=1)

  • Group Key: w.transaction_wallet_id, w.orderid, w.account_id, w.payment_id_ch, t.userid, w.userid, w.account_userid, t.statusid, p.payment_statusid, w.wallet_transaction_status, w.wallet_movement_status, w.transaction_created_date, t.creation_date, t.status_date, p.created_date, w.account_type, w.account_desc, t.main_card_type, t.billing, w.transaction_amount, ((t.wallet_amount / t.currency_rate)), ((t.creditcard_amount / t.currency_rate)), ((t.extra_charge_summa / t.currency_rate)), ((t.financing_summa / t.currency_rate)), ((t.pay_summa / t.currency_rate)), ((t.pin_cost / t.currency_rate)), p.payment_amount
2. 8,985.572 112,894.191 ↓ 29.5 5,256,211 1

Sort (cost=5,179,116.81..5,179,562.27 rows=178,185 width=359) (actual time=111,757.416..112,894.191 rows=5,256,211 loops=1)

  • Sort Key: w.transaction_wallet_id, w.orderid, w.account_id, w.payment_id_ch, t.userid, w.userid, w.account_userid, t.statusid, p.payment_statusid, w.wallet_transaction_status, w.wallet_movement_status, w.transaction_created_date, t.creation_date, t.status_date, p.created_date, w.account_type, w.account_desc, t.main_card_type, t.billing, w.transaction_amount, ((t.wallet_amount / t.currency_rate)), ((t.creditcard_amount / t.currency_rate)), ((t.extra_charge_summa / t.currency_rate)), ((t.financing_summa / t.currency_rate)), ((t.pay_summa / t.currency_rate)), ((t.pin_cost / t.currency_rate)), p.payment_amount
  • Sort Method: external merge Disk: 1,267,816kB
3. 0.000 103,908.619 ↓ 29.5 5,256,211 1

Gather (cost=1,001.00..5,163,576.39 rows=178,185 width=359) (actual time=1.798..103,908.619 rows=5,256,211 loops=1)

  • Workers Planned: 7
  • Workers Launched: 6
4. 1,277.704 106,518.157 ↓ 29.5 750,887 7 / 7

Nested Loop Left Join (cost=1.00..5,142,466.94 rows=25,455 width=359) (actual time=1.223..106,518.157 rows=750,887 loops=7)

5. 3,422.297 69,948.757 ↓ 29.5 750,887 7 / 7

Nested Loop (cost=0.43..4,968,831.86 rows=25,455 width=182) (actual time=1.187..69,948.757 rows=750,887 loops=7)

6. 42,433.408 42,433.408 ↓ 190.6 6,023,263 7 / 7

Parallel Seq Scan on transactions t (cost=0.00..4,755,396.32 rows=31,604 width=76) (actual time=0.071..42,433.408 rows=6,023,263 loops=7)

  • Filter: (main_card_type = card_type)
  • Rows Removed by Filter: 285,537
7. 24,093.052 24,093.052 ↓ 0.0 0 42,162,841 / 7

Index Scan using wallet_orderid_idx on wallet w (cost=0.43..6.74 rows=1 width=110) (actual time=0.004..0.004 rows=0 loops=42,162,841)

  • Index Cond: (orderid = t.orderid)
  • Filter: ((transaction_created_date)::date >= '2020-04-01'::date)
  • Rows Removed by Filter: 0
8. 35,291.696 35,291.696 ↑ 1.0 1 5,256,210 / 7

Index Scan using payments__payment_id_ch_idx on payments p (cost=0.56..6.80 rows=1 width=30) (actual time=0.046..0.047 rows=1 loops=5,256,210)

  • Index Cond: ((w.payment_id_ch)::text = (payment_id_ch)::text)
Planning time : 5.287 ms
Execution time : 126,960.725 ms