explain.depesz.com

PostgreSQL's explain analyze made readable

Result: MaMS

Settings
# exclusive inclusive rows x rows loops node
1. 1,042.245 56,603.642 ↓ 36.2 946,917 1

Finalize GroupAggregate (cost=1,621,404.17..1,627,331.79 rows=26,168 width=373) (actual time=54,807.779..56,603.642 rows=946,917 loops=1)

  • Group Key: w.transaction_wallet_id, w.transaction_created_date, w.orderid, ac.type_id, w.wallet_transaction_status, m.status, m.account, (split_part((ac.type)::text, '-'::text, 1)), ac.type, w.payment_id_ch, t.statusid, p.payment_statusid, t.creation_date, p.created_date, t.main_card_type, ((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. 593.377 55,561.397 ↓ 36.2 946,980 1

Gather Merge (cost=1,621,404.17..1,624,976.79 rows=26,166 width=373) (actual time=54,807.763..55,561.397 rows=946,980 loops=1)

  • Workers Planned: 6
  • Workers Launched: 6
3. 149.877 54,968.020 ↓ 31.0 135,283 7 / 7

Partial GroupAggregate (cost=1,620,404.07..1,620,796.56 rows=4,361 width=373) (actual time=54,801.505..54,968.020 rows=135,283 loops=7)

  • Group Key: w.transaction_wallet_id, w.transaction_created_date, w.orderid, ac.type_id, w.wallet_transaction_status, m.status, m.account, (split_part((ac.type)::text, '-'::text, 1)), ac.type, w.payment_id_ch, t.statusid, p.payment_statusid, t.creation_date, p.created_date, t.main_card_type, ((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
4. 150.403 54,818.143 ↓ 31.0 135,285 7 / 7

Sort (cost=1,620,404.07..1,620,414.97 rows=4,361 width=344) (actual time=54,801.484..54,818.143 rows=135,285 loops=7)

  • Sort Key: w.transaction_wallet_id, w.transaction_created_date, w.orderid, ac.type_id, w.wallet_transaction_status, m.status, m.account, (split_part((ac.type)::text, '-'::text, 1)), ac.type, w.payment_id_ch, t.statusid, p.payment_statusid, t.creation_date, p.created_date, t.main_card_type, ((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: quicksort Memory: 42,035kB
5. 320.294 54,667.740 ↓ 31.0 135,285 7 / 7

Nested Loop Left Join (cost=2.27..1,620,140.44 rows=4,361 width=344) (actual time=78.849..54,667.740 rows=135,285 loops=7)

6. 16.890 35,407.566 ↓ 31.0 135,285 7 / 7

Nested Loop (cost=1.70..1,585,163.82 rows=4,361 width=135) (actual time=77.971..35,407.566 rows=135,285 loops=7)

7. 63.996 21,861.919 ↓ 29.7 135,288 7 / 7

Nested Loop (cost=1.14..1,549,083.19 rows=4,553 width=110) (actual time=77.331..21,861.919 rows=135,288 loops=7)

8. 128.155 7,186.865 ↓ 29.7 135,288 7 / 7

Nested Loop (cost=0.56..1,511,550.31 rows=4,553 width=98) (actual time=74.814..7,186.865 rows=135,288 loops=7)

9. 422.185 422.185 ↑ 1.0 135,439 7 / 7

Parallel Seq Scan on wallet w (cost=0.00..371,389.08 rows=135,484 width=49) (actual time=74.084..422.185 rows=135,439 loops=7)

  • Filter: (((account_desc)::text = ANY ('{recarga-assigned-1st-purchase-cashbacks,recarga-assigned-new-cashbacks,recarga-volatile-cashbacks}'::text[])) AND ((transaction_created_date)::date >= '2020-04-01'::date) AND ((transaction_created_date)::date >= '2020-05-15'::date))
  • Rows Removed by Filter: 626,392
10. 6,636.525 6,636.525 ↑ 1.0 1 948,075 / 7

Index Scan using transactions_orderid_idx on transactions t (cost=0.56..8.41 rows=1 width=53) (actual time=0.048..0.049 rows=1 loops=948,075)

  • Index Cond: (orderid = w.orderid)
  • Filter: (main_card_type = card_type)
  • Rows Removed by Filter: 0
11. 14,611.058 14,611.058 ↑ 1.0 1 947,013 / 7

Index Scan using movement_pkey on movement m (cost=0.57..8.24 rows=1 width=28) (actual time=0.108..0.108 rows=1 loops=947,013)

  • Index Cond: (id = w.target)
12. 13,528.757 13,528.757 ↑ 1.0 1 947,013 / 7

Index Scan using account_pkey on account ac (cost=0.56..7.92 rows=1 width=33) (actual time=0.100..0.100 rows=1 loops=947,013)

  • Index Cond: (id = m.account)
  • Filter: ((type)::text ~~ 'user%'::text)
  • Rows Removed by Filter: 0
13. 18,939.880 18,939.880 ↑ 1.0 1 946,994 / 7

Index Scan using payments__payment_id_ch_idx on payments p (cost=0.56..7.99 rows=1 width=30) (actual time=0.139..0.140 rows=1 loops=946,994)

  • Index Cond: ((w.payment_id_ch)::text = (payment_id_ch)::text)
Planning time : 6.485 ms
Execution time : 56,653.678 ms