explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jaQM

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Nested Loop (cost=16.66..34.06 rows=1 width=32) (actual rows= loops=)

  • Join Filter: (t.account_id = a.id)
2.          

CTE updated_rows

3. 0.000 0.000 ↓ 0.0

Update on tickets (cost=8.34..16.50 rows=1 width=571) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=8.34..16.50 rows=1 width=571) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

HashAggregate (cost=8.20..8.21 rows=1 width=32) (actual rows= loops=)

  • Group Key: "ANY_subquery".id
6. 0.000 0.000 ↓ 0.0

Subquery Scan on ANY_subquery (cost=0.14..8.20 rows=1 width=32) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Limit (cost=0.14..8.19 rows=1 width=18) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

LockRows (cost=0.14..8.19 rows=1 width=18) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Index Scan using tickets_confirmation_status_last_check_time_idx on tickets tickets_1 (cost=0.14..8.18 rows=1 width=18) (actual rows= loops=)

  • Index Cond: (confirmation_status = 'pending'::text)
  • Filter: ((deleted_at IS NULL) AND ((last_check_time)::double precision < (date_part('epoch'::text, CURRENT_TIMESTAMP) - '2'::double precision)))
10. 0.000 0.000 ↓ 0.0

Index Scan using tickets_pkey on tickets (cost=0.14..8.16 rows=1 width=491) (actual rows= loops=)

  • Index Cond: (id = "ANY_subquery".id)
11. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.17..6.84 rows=1 width=553) (actual rows= loops=)

  • Join Filter: (ebd.id = t.external_billing_id)
12. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.17..5.80 rows=1 width=521) (actual rows= loops=)

  • Join Filter: (p.id = t.payment_method_id)
13. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.17..4.66 rows=1 width=493) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Hash Join (cost=0.03..1.15 rows=1 width=465) (actual rows= loops=)

  • Hash Cond: (d.id = t.device_id)
15. 0.000 0.000 ↓ 0.0

Seq Scan on devices d (cost=0.00..1.08 rows=8 width=76) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Hash (cost=0.02..0.02 rows=1 width=397) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

CTE Scan on updated_rows t (cost=0.00..0.02 rows=1 width=397) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Index Scan using pk_device_types_dict on device_types_dict dtd (cost=0.14..3.15 rows=1 width=36) (actual rows= loops=)

  • Index Cond: (id = d.device_type_id)
19. 0.000 0.000 ↓ 0.0

Seq Scan on payment_methods_dict p (cost=0.00..1.06 rows=6 width=36) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Seq Scan on external_billings_dict ebd (cost=0.00..1.02 rows=2 width=36) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Seq Scan on accounts a (cost=0.00..1.08 rows=8 width=152) (actual rows= loops=)

22.          

SubPlan (for Nested Loop)

23. 0.000 0.000 ↓ 0.0

Aggregate (cost=9.52..9.53 rows=1 width=32) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on bank_cards b (cost=4.16..9.50 rows=2 width=211) (actual rows= loops=)

  • Recheck Cond: (account_id = t.account_id)
25. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on bank_cards_accounts_id_idx (cost=0.00..4.16 rows=2 width=0) (actual rows= loops=)