explain.depesz.com

PostgreSQL's explain analyze made readable

Result: x2GT

Settings

Optimization(s) for this plan:

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

Limit (cost=19.33..19.49 rows=1 width=9,718) (actual time=0.403..0.403 rows=0 loops=1)

2. 0.001 0.403 ↓ 0.0 0 1

Unique (cost=19.33..19.49 rows=1 width=9,718) (actual time=0.403..0.403 rows=0 loops=1)

3. 0.018 0.402 ↓ 0.0 0 1

Sort (cost=19.33..19.33 rows=1 width=9,718) (actual time=0.402..0.402 rows=0 loops=1)

  • Sort Key: subscripti0_.creation_date DESC, subscripti0_.id, subscripti0_.version, subscripti0_.modification_date, subscripti0_.object_name, subscripti0_.owner_membership, subscripti0_.lifecycle_change_date, subscripti0_.cancellation_choice, subscripti0_.cancellation_period, subscripti0_.overdue_amount, subscripti0_.overdue_period, subscripti0_.product_display, subscripti0_.product_path, subscripti0_.product_sku, subscripti0_.regular_period, subscripti0_.regular_period_discount_duration, subscripti0_.regular_period_price_discount_amount, subscripti0_.regular_period_price_list_amount, subscripti0_.regular_period_price_shipping_amount, subscripti0_.regular_period_product, subscripti0_.reminder_period, subscripti0_.send_payment_overdue, subscripti0_.send_reminder_enabled, subscripti0_.account, subscripti0_.start_date, subscripti0_.begin_period_end_date, subscripti0_.canceled_date, subscripti0_.currency, subscripti0_.custom_reference_id, subscripti0_.customer_external_reference, subscripti0_.deactivation_date, subscripti0_.end_date, subscripti0_.import_identifier, subscripti0_.last_dunning_step, subscripti0_.last_dunning_step_date, subscripti0_.event_context, subscripti0_.manual_renew, subscripti0_.master_payment, subscripti0_.mode, subscripti0_.next_date, subscripti0_.notification_date, subscripti0_.offer_coupon_instance, subscripti0_.overdue_notifications_sent, subscripti0_.payment_method_expiration_date, subscripti0_.price_decoration, subscripti0_.primary_external_reference, subscripti0_.quantity, subscripti0_.status, subscripti0_.receiver_address, subscripti0_.receiver_contact, subscripti0_.referrer, subscripti0_.regular_period_campaign, subscripti0_.regular_period_offer_type, subscripti0_.regular_period_subtotal, subscripti0_.source, subscripti0_.source_campaign, subscripti0_.source_key, subscripti0_.store_tax_price_mode, subscripti0_.tags, subscripti0_.tax_exemption_data, subscripti0_.trial_reminder_days, subscripti0_.trial_reminder_enabled, subscripti0_.type, subscripti0_.using_new_notifications
  • Sort Method: quicksort Memory: 25kB
4. 0.022 0.384 ↓ 0.0 0 1

Nested Loop (cost=15.55..19.32 rows=1 width=9,718) (actual time=0.384..0.384 rows=0 loops=1)

5. 0.042 0.218 ↓ 72.0 72 1

Hash Join (cost=15.41..18.55 rows=1 width=50) (actual time=0.176..0.218 rows=72 loops=1)

  • Hash Cond: (((entryassoc1_.subscription)::text = (subscripti2_.subscription)::text) AND (entryassoc1_.creation_date = (max(subscripti2_.creation_date))))
6. 0.016 0.016 ↓ 1.1 86 1

Seq Scan on subscription_entry entryassoc1_ (cost=0.00..2.75 rows=75 width=35) (actual time=0.008..0.016 rows=86 loops=1)

7. 0.023 0.160 ↓ 1.1 72 1

Hash (cost=14.47..14.47 rows=63 width=31) (actual time=0.160..0.160 rows=72 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 13kB
8. 0.040 0.137 ↓ 1.1 72 1

HashAggregate (cost=13.21..13.84 rows=63 width=31) (actual time=0.125..0.137 rows=72 loops=1)

  • Group Key: subscripti2_.subscription
9. 0.043 0.097 ↓ 1.1 86 1

Hash Join (cost=9.87..12.83 rows=75 width=31) (actual time=0.056..0.097 rows=86 loops=1)

  • Hash Cond: ((subscripti2_.subscription)::text = (subscripti3_.id)::text)
10. 0.012 0.012 ↓ 1.1 86 1

Seq Scan on subscription_entry subscripti2_ (cost=0.00..2.75 rows=75 width=31) (actual time=0.002..0.012 rows=86 loops=1)

11. 0.016 0.042 ↓ 1.1 72 1

Hash (cost=9.09..9.09 rows=63 width=23) (actual time=0.042..0.042 rows=72 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 12kB
12. 0.026 0.026 ↓ 1.1 72 1

Index Only Scan using subscription_pkey on subscription subscripti3_ (cost=0.14..9.09 rows=63 width=23) (actual time=0.009..0.026 rows=72 loops=1)

  • Heap Fetches: 34
13. 0.144 0.144 ↓ 0.0 0 72

Index Scan using subscription_pkey on subscription subscripti0_ (cost=0.14..0.75 rows=1 width=9,718) (actual time=0.002..0.002 rows=0 loops=72)

  • Index Cond: ((id)::text = (entryassoc1_.subscription)::text)
  • Filter: ((begin_period_end_date IS NOT NULL) AND ((site)::text = 'TY1L8QRlRHY'::text) AND ((lifecycle)::text = 'SUBL.A'::text) AND (entryassoc1_.period_date < begin_period_end_date))
  • Rows Removed by Filter: 1
Planning time : 1.055 ms