explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GZRA

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

Limit (cost=32,091.41..32,109.67 rows=1 width=32) (actual rows= loops=)

2.          

CTE updated_rows

3. 0.000 0.000 ↓ 0.0

Update on tickets (cost=32,082.36..32,090.40 rows=1 width=911) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=32,082.36..32,090.40 rows=1 width=911) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

HashAggregate (cost=32,081.93..32,081.94 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=32,081.90..32,081.93 rows=1 width=32) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Limit (cost=32,081.90..32,081.92 rows=1 width=18) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

LockRows (cost=32,081.90..32,081.92 rows=1 width=18) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Sort (cost=32,081.90..32,081.91 rows=1 width=18) (actual rows= loops=)

  • Sort Key: tickets_1.last_check_time
10. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on tickets tickets_1 (cost=203.77..32,081.89 rows=1 width=18) (actual rows= loops=)

  • Recheck Cond: ((((product_details ->> 'expiration_date'::text))::integer > ((date_part('epoch'::text, CURRENT_TIMESTAMP) - '10000'::double precision))::integer) AND (((product_details ->> 'expiration_date'::text))::integer < ((date_part('epoch'::text, CURRENT_TIMESTAMP) + '10000'::double precision))::integer) AND (type = 'service'::text) AND ((product_details ->> 'expiration_date'::text) IS NOT NULL))
  • Filter: ((deleted_at IS NULL) AND ((intent_id IS NOT NULL) OR (receipt_id IS NOT NULL)) AND (confirmation_status <> 'renewed'::text) AND (status = 'new'::text) AND ((last_check_time)::double precision < (date_part('epoch'::text, CURRENT_TIMESTAMP) - '10000'::double precision)))
11. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on tickets_product_details_expiration_date_int_idx (cost=0.00..203.77 rows=9,532 width=0) (actual rows= loops=)

  • Index Cond: ((((product_details ->> 'expiration_date'::text))::integer > ((date_part('epoch'::text, CURRENT_TIMESTAMP) - '10000'::double precision))::integer) AND (((product_details ->> 'expiration_date'::text))::integer < ((date_part('epoch'::text, CURRENT_TIMESTAMP) + '10000'::double precision))::integer))
12. 0.000 0.000 ↓ 0.0

Index Scan using tickets_pkey on tickets (cost=0.43..8.45 rows=1 width=863) (actual rows= loops=)

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

Nested Loop (cost=1.01..19.27 rows=1 width=32) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.57..10.81 rows=1 width=478) (actual rows= loops=)

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

Nested Loop Left Join (cost=0.57..9.76 rows=1 width=472) (actual rows= loops=)

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

Nested Loop Left Join (cost=0.57..8.63 rows=1 width=463) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.43..8.47 rows=1 width=456) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

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

19. 0.000 0.000 ↓ 0.0

Index Scan using devices_id_key on devices d (cost=0.43..8.45 rows=1 width=67) (actual rows= loops=)

  • Index Cond: (id = t.device_id)
20. 0.000 0.000 ↓ 0.0

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

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

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

22. 0.000 0.000 ↓ 0.0

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

23. 0.000 0.000 ↓ 0.0

Index Scan using accounts_pkey on accounts a (cost=0.43..8.45 rows=1 width=29) (actual rows= loops=)