explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HO4p

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

Limit (cost=281,444.32..281,462.59 rows=1 width=32) (actual rows= loops=)

2.          

CTE updated_rows

3. 0.000 0.000 ↓ 0.0

Update on tickets (cost=281,435.27..281,443.31 rows=1 width=911) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=281,435.27..281,443.31 rows=1 width=911) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

HashAggregate (cost=281,434.84..281,434.85 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=281,434.82..281,434.84 rows=1 width=32) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Limit (cost=281,434.82..281,434.83 rows=1 width=18) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

LockRows (cost=281,434.82..281,434.83 rows=1 width=18) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Sort (cost=281,434.82..281,434.82 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=33,560.50..281,434.81 rows=1 width=18) (actual rows= loops=)

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

BitmapOr (cost=33,560.50..33,560.50 rows=682,087 width=0) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on tickets_intent_id_key (cost=0.00..17,779.24 rows=365,175 width=0) (actual rows= loops=)

  • Index Cond: (intent_id IS NOT NULL)
13. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on tickets_receipt_id_key (cost=0.00..15,781.26 rows=316,912 width=0) (actual rows= loops=)

  • Index Cond: (receipt_id IS NOT NULL)
14. 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)
15. 0.000 0.000 ↓ 0.0

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

16. 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)
17. 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)
18. 0.000 0.000 ↓ 0.0

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

19. 0.000 0.000 ↓ 0.0

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

20. 0.000 0.000 ↓ 0.0

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

21. 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)
22. 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)
23. 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=)

24. 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=)

25. 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=)