explain.depesz.com

PostgreSQL's explain analyze made readable

Result: MzJs

Settings
# exclusive inclusive rows x rows loops node
1. 1,025.020 138,870.010 ↓ 35.8 932,159 1

Finalize GroupAggregate (cost=1,611,288.42..1,617,183.30 rows=26,020 width=373) (actual time=137,124.227..138,870.010 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. 566.296 137,844.990 ↓ 35.8 932,223 1

Gather Merge (cost=1,611,288.42..1,614,841.38 rows=26,022 width=373) (actual time=137,124.214..137,844.990 rows=932,223 loops=1)

  • Workers Planned: 6
  • Workers Launched: 6
3. 146.504 137,278.694 ↓ 30.7 133,175 7 / 7

Partial GroupAggregate (cost=1,610,288.32..1,610,678.65 rows=4,337 width=373) (actual time=137,115.804..137,278.694 rows=133,175 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. 159.055 137,132.190 ↓ 30.7 133,176 7 / 7

Sort (cost=1,610,288.32..1,610,299.16 rows=4,337 width=344) (actual time=137,115.774..137,132.190 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,462kB
5. 365.461 136,973.135 ↓ 30.7 133,176 7 / 7

Nested Loop Left Join (cost=2.27..1,610,026.31 rows=4,337 width=344) (actual time=1,184.049..136,973.135 rows=133,176 loops=7)

6. 22.725 97,587.022 ↓ 30.7 133,176 7 / 7

Nested Loop (cost=1.70..1,575,245.89 rows=4,337 width=135) (actual time=1,182.036..97,587.022 rows=133,176 loops=7)

7. 75.832 64,935.477 ↓ 29.4 133,179 7 / 7

Nested Loop (cost=1.14..1,539,376.25 rows=4,527 width=110) (actual time=1,181.188..64,935.477 rows=133,179 loops=7)

8. 169.892 49,410.898 ↓ 29.4 133,179 7 / 7

Nested Loop (cost=0.56..1,502,055.45 rows=4,527 width=98) (actual time=1,179.700..49,410.898 rows=133,179 loops=7)

9. 2,336.802 2,336.802 ↑ 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=1,178.019..2,336.802 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. 46,904.204 46,904.204 ↑ 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.344..0.349 rows=1 loops=940,772)

  • Index Cond: (orderid = w.orderid)
  • Filter: (main_card_type = card_type)
  • Rows Removed by Filter: 0
11. 15,448.747 15,448.747 ↑ 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.116..0.116 rows=1 loops=932,252)

  • Index Cond: (id = w.target)
12. 32,628.820 32,628.820 ↑ 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.245..0.245 rows=1 loops=932,252)

  • Index Cond: (id = m.account)
  • Filter: ((type)::text ~~ 'user%'::text)
  • Rows Removed by Filter: 0
13. 39,020.652 39,020.652 ↑ 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.293..0.293 rows=1 loops=932,234)

  • Index Cond: ((w.payment_id_ch)::text = (payment_id_ch)::text)
Planning time : 55.229 ms
Execution time : 138,917.863 ms