explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2IhK

Settings
# exclusive inclusive rows x rows loops node
1. 43.153 43.153 ↓ 13,959.0 13,959 1

CTE Scan on debited_transactions (cost=8.95..8.97 rows=1 width=12) (actual time=35.342..43.153 rows=13,959 loops=1)

2.          

CTE users

3. 0.001 0.007 ↑ 1.0 1 1

Limit (cost=0.43..2.65 rows=1 width=4) (actual time=0.006..0.007 rows=1 loops=1)

4. 0.006 0.006 ↑ 1.0 1 1

Index Scan using rappi_credits_application_user_id_index_dba_20191006 on rappi_credits (cost=0.43..2.65 rows=1 width=4) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: (application_user_id = '307984336'::bigint)
5.          

CTE debited_transactions

6. 3.577 39.942 ↓ 13,959.0 13,959 1

GroupAggregate (cost=6.27..6.29 rows=1 width=16) (actual time=35.340..39.942 rows=13,959 loops=1)

  • Group Key: rcdo.rappi_credit_paid_transaction_id
7. 4.585 36.365 ↓ 15,938.0 15,938 1

Sort (cost=6.27..6.28 rows=1 width=12) (actual time=35.332..36.365 rows=15,938 loops=1)

  • Sort Key: rcdo.rappi_credit_paid_transaction_id
  • Sort Method: quicksort Memory: 1132kB
8. 8.836 31.780 ↓ 15,938.0 15,938 1

Nested Loop (cost=1.01..6.26 rows=1 width=12) (actual time=0.030..31.780 rows=15,938 loops=1)

9. 1.608 6.977 ↓ 5,322.3 15,967 1

Nested Loop (cost=0.57..4.82 rows=3 width=12) (actual time=0.026..6.977 rows=15,967 loops=1)

10. 0.009 0.009 ↑ 1.0 1 1

CTE Scan on users (cost=0.00..0.02 rows=1 width=4) (actual time=0.007..0.009 rows=1 loops=1)

11. 5.360 5.360 ↓ 5,322.3 15,967 1

Index Scan using rappi_credit_transactions_rappi_credit_id_state_dba on rappi_credit_transactions rct (cost=0.57..4.77 rows=3 width=16) (actual time=0.018..5.360 rows=15,967 loops=1)

  • Index Cond: ((rappi_credit_id = users.id) AND ((state)::text = 'debited'::text))
  • Filter: (order_id <> 58529974)
12. 15.967 15.967 ↑ 1.0 1 15,967

Index Scan using rappi_credit_debit_origins_rappi_credit_debit_transaction_id_in on rappi_credit_debit_origins rcdo (cost=0.44..0.47 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=15,967)

  • Index Cond: (rappi_credit_debit_transaction_id = rct.id)
Planning time : 1.274 ms
Execution time : 43.860 ms