explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9DA3y

Settings
# exclusive inclusive rows x rows loops node
1. 1,023.398 44,910.987 ↓ 35.8 932,159 1

Finalize GroupAggregate (cost=1,611,286.54..1,617,181.42 rows=26,020 width=373) (actual time=43,166.308..44,910.987 rows=932,159 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. 563.020 43,887.589 ↓ 35.8 932,219 1

Gather Merge (cost=1,611,286.54..1,614,839.50 rows=26,022 width=373) (actual time=43,166.294..43,887.589 rows=932,219 loops=1)

  • Workers Planned: 6
  • Workers Launched: 6
3. 150.604 43,324.569 ↓ 30.7 133,174 7 / 7

Partial GroupAggregate (cost=1,610,286.44..1,610,676.77 rows=4,337 width=373) (actual time=43,155.963..43,324.569 rows=133,174 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. 151.267 43,173.965 ↓ 30.7 133,176 7 / 7

Sort (cost=1,610,286.44..1,610,297.28 rows=4,337 width=344) (actual time=43,155.936..43,173.965 rows=133,176 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: 41,383kB
5. 266.722 43,022.698 ↓ 30.7 133,176 7 / 7

Nested Loop Left Join (cost=2.27..1,610,024.43 rows=4,337 width=344) (actual time=175.602..43,022.698 rows=133,176 loops=7)

6. 58.317 22,246.828 ↓ 30.7 133,176 7 / 7

Nested Loop (cost=1.70..1,575,244.12 rows=4,337 width=135) (actual time=175.500..22,246.828 rows=133,176 loops=7)

7. 26.257 9,669.698 ↓ 29.4 133,179 7 / 7

Nested Loop (cost=1.14..1,539,374.64 rows=4,527 width=110) (actual time=175.430..9,669.698 rows=133,179 loops=7)

8. 104.396 3,384.035 ↓ 29.4 133,179 7 / 7

Nested Loop (cost=0.56..1,502,053.93 rows=4,527 width=98) (actual time=175.414..3,384.035 rows=133,179 loops=7)

9. 860.511 860.511 ↑ 1.0 134,396 7 / 7

Parallel Seq Scan on wallet w (cost=0.00..368,442.67 rows=134,718 width=49) (actual time=173.989..860.511 rows=134,396 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: 622,123
10. 2,419.128 2,419.128 ↑ 1.0 1 940,772 / 7

Index Scan using transactions_orderid_idx on transactions t (cost=0.56..8.40 rows=1 width=53) (actual time=0.017..0.018 rows=1 loops=940,772)

  • Index Cond: (orderid = w.orderid)
  • Filter: (main_card_type = card_type)
  • Rows Removed by Filter: 0
11. 6,259.406 6,259.406 ↑ 1.0 1 932,252 / 7

Index Scan using movement_pkey on movement m (cost=0.57..8.24 rows=1 width=28) (actual time=0.047..0.047 rows=1 loops=932,252)

  • Index Cond: (id = w.target)
12. 12,518.813 12,518.813 ↑ 1.0 1 932,252 / 7

Index Scan using account_pkey on account ac (cost=0.56..7.92 rows=1 width=33) (actual time=0.094..0.094 rows=1 loops=932,252)

  • Index Cond: (id = m.account)
  • Filter: ((type)::text ~~ 'user%'::text)
  • Rows Removed by Filter: 0
13. 20,509.148 20,509.148 ↑ 1.0 1 932,234 / 7

Index Scan using payments__payment_id_ch_idx on payments p (cost=0.56..7.99 rows=1 width=30) (actual time=0.153..0.154 rows=1 loops=932,234)

  • Index Cond: ((w.payment_id_ch)::text = (payment_id_ch)::text)
Planning time : 2.816 ms
Execution time : 44,959.488 ms