explain.depesz.com

PostgreSQL's explain analyze made readable

Result: eiU7

Settings
# exclusive inclusive rows x rows loops node
1. 13,233.680 159,481.347 ↓ 29.5 5,253,506 1

GroupAggregate (cost=5,178,574.90..5,198,175.25 rows=178,185 width=382) (actual time=145,151.685..159,481.347 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,856.856 146,247.667 ↓ 29.5 5,256,211 1

Sort (cost=5,178,574.90..5,179,020.37 rows=178,185 width=359) (actual time=145,151.647..146,247.667 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,808kB
3. 0.000 137,390.811 ↓ 29.5 5,256,211 1

Gather (cost=1,001.00..5,163,034.48 rows=178,185 width=359) (actual time=3.408..137,390.811 rows=5,256,211 loops=1)

  • Workers Planned: 7
  • Workers Launched: 7
4. 1,069.849 140,340.864 ↓ 25.8 657,026 8 / 8

Nested Loop Left Join (cost=1.00..5,141,925.03 rows=25,455 width=359) (actual time=2.543..140,340.864 rows=657,026 loops=8)

5. 1,633.403 68,312.180 ↓ 25.8 657,026 8 / 8

Nested Loop (cost=0.43..4,968,289.95 rows=25,455 width=182) (actual time=1.269..68,312.180 rows=657,026 loops=8)

6. 40,327.001 40,327.001 ↓ 167.1 5,270,355 8 / 8

Parallel Seq Scan on transactions t (cost=0.00..4,755,245.99 rows=31,544 width=76) (actual time=0.355..40,327.001 rows=5,270,355 loops=8)

  • Filter: (main_card_type = card_type)
  • Rows Removed by Filter: 249,844
7. 26,351.776 26,351.776 ↓ 0.0 0 42,162,841 / 8

Index Scan using wallet_orderid_idx on wallet w (cost=0.43..6.74 rows=1 width=110) (actual time=0.005..0.005 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. 70,958.835 70,958.835 ↑ 1.0 1 5,256,210 / 8

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

  • Index Cond: ((w.payment_id_ch)::text = (payment_id_ch)::text)
Planning time : 4.603 ms
Execution time : 159,947.617 ms