explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DWKm

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.230 2,571.502 ↑ 693.4 119 1

Unique (cost=411,743.77..431,135.03 rows=82,516 width=2,756) (actual time=2,571.248..2,571.502 rows=119 loops=1)

2. 0.478 2,571.272 ↑ 693.4 119 1

Sort (cost=411,743.77..411,950.06 rows=82,516 width=2,756) (actual time=2,571.247..2,571.272 rows=119 loops=1)

  • Sort Key: core_offer.id, core_offer.ecpc, core_offer.ecpc_prev, core_offer.conversion_rate, core_offer.conversion_rate_prev, core_offer.name, core_offer.name_ru, core_offer.name_en, core_offer.alternative_name, core_offer.alternative_name_ru, core_offer.alternative_name_en, core_offer.search_options, core_offer.slug, core_offer.product_id, core_offer.site_url, core_offer.currency_id, core_offer.created_dt, core_offer.publish_dt, core_offer.publisher_id, core_offer.advertiser_id, core_offer.need_flow_moderation, core_offer.is_active, core_offer.is_pre_closing, core_offer.logo, core_offer.description, core_offer.description_ru, core_offer.description_en, core_offer.seo_text, core_offer.seo_text_ru, core_offer.seo_text_en, core_offer.rules, core_offer.rules_ru, core_offer.rules_en, core_offer.min_access_level, core_offer.min_access_level_without_moderation, core_offer.cookie_ttl, core_offer.confirm_rate, core_offer.avg_processing, core_offer.count_active_flows, core_offer.is_hidden, core_offer.conversion_limit, core_offer.conversion_limit_currency_id, core_offer.disabled_until_dt, core_offer.flow_limit, core_offer.flow_limit_type, core_offer.is_exclusive, core_offer.bonus_inducing, (sum(CASE WHEN (core_flow.wm_id = 7716) THEN 1 ELSE 0 END)), (sum(CASE WHEN (core_channel_wm.user_id = 7716) THEN 1 ELSE 0 END)), core_currency.id, core_currency.update_dt, core_currency.char_code, core_currency.name, core_currency.name_ru, core_currency.name_en, core_currency.value, core_currency.min_reserve_amount, core_currency.is_visible, core_publisher.id, core_publisher.name, core_publisher.name_ru, core_publisher.name_en, t9.password, t9.last_login, t9.is_superuser, t9.email, t9.first_name, t9.last_name, t9.is_staff, t9.is_active, t9.date_joined, t9.date_bonus_activated, t9.email_is_confirmed, t9.default_currency_id, t9.phone, t9.role, t9.access_level, t9.manager_id, t9.manager_comment, t9.have_own_partner_program, t9.work_with_another_cpa_systems, t9.receive_notifications, t9.referrer_id, t9.referral_prc, t9.http_referrer, t9.billing_day, t9.cashout_available, t9.zaleycash_bonus, t9.vk, t9.fb, t9.telegram, t9.skype, t9.ga_cid
  • Sort Method: quicksort Memory: 368kB
3. 170.646 2,570.794 ↑ 693.4 119 1

GroupAggregate (cost=205,197.42..208,704.35 rows=82,516 width=2,756) (actual time=2,147.377..2,570.794 rows=119 loops=1)

  • Group Key: core_offer.id, core_currency.id, core_publisher.id, t9.id
  • Filter: ((NOT core_offer.is_hidden) OR (sum(CASE WHEN (core_channel_wm.user_id = 7716) THEN 1 ELSE 0 END) > 0) OR (sum(CASE WHEN (core_flow.wm_id = 7716) THEN 1 ELSE 0 END) > 0))
  • Rows Removed by Filter: 94
4. 2,075.245 2,400.148 ↓ 3.7 302,604 1

Sort (cost=205,197.42..205,403.71 rows=82,516 width=2,748) (actual time=2,130.012..2,400.148 rows=302,604 loops=1)

  • Sort Key: core_offer.id, core_currency.id, core_publisher.id, t9.id
  • Sort Method: external merge Disk: 578856kB
5. 303.640 324.903 ↓ 3.7 302,604 1

Hash Right Join (cost=1,068.66..2,725.00 rows=82,516 width=2,748) (actual time=15.413..324.903 rows=302,604 loops=1)

  • Hash Cond: (core_flow.offer_id = core_offer.id)
6. 5.888 5.888 ↓ 1.0 25,389 1

Seq Scan on core_flow (cost=0.00..610.14 rows=25,214 width=8) (actual time=0.017..5.888 rows=25,389 loops=1)

7. 4.338 15.375 ↓ 1.2 1,122 1

Hash (cost=1,056.87..1,056.87 rows=943 width=2,744) (actual time=15.375..15.375 rows=1,122 loops=1)

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 2197kB
8. 2.361 11.037 ↓ 1.2 1,122 1

Hash Right Join (cost=1,020.63..1,056.87 rows=943 width=2,744) (actual time=8.457..11.037 rows=1,122 loops=1)

  • Hash Cond: (core_channel_wm.channel_id = core_channel.id)
9. 0.252 0.252 ↑ 1.0 1,316 1

Seq Scan on core_channel_wm (cost=0.00..21.68 rows=1,368 width=8) (actual time=0.013..0.252 rows=1,316 loops=1)

10. 3.094 8.424 ↓ 1.3 758 1

Hash (cost=1,013.33..1,013.33 rows=584 width=2,744) (actual time=8.424..8.424 rows=758 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1486kB
11. 1.678 5.330 ↓ 1.3 758 1

Hash Right Join (cost=989.05..1,013.33 rows=584 width=2,744) (actual time=3.501..5.330 rows=758 loops=1)

  • Hash Cond: (core_channel.offer_id = core_offer.id)
12. 0.187 0.187 ↓ 1.0 840 1

Seq Scan on core_channel (cost=0.00..15.32 rows=832 width=8) (actual time=0.016..0.187 rows=840 loops=1)

13. 1.053 3.465 ↓ 1.1 213 1

Hash (cost=986.53..986.53 rows=202 width=2,740) (actual time=3.465..3.465 rows=213 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 416kB
14. 0.293 2.412 ↓ 1.1 213 1

Nested Loop (cost=5.31..986.53 rows=202 width=2,740) (actual time=0.192..2.412 rows=213 loops=1)

15. 0.183 1.267 ↓ 1.1 213 1

Hash Left Join (cost=5.03..111.91 rows=202 width=2,273) (actual time=0.180..1.267 rows=213 loops=1)

  • Hash Cond: (core_offer.publisher_id = core_publisher.id)
16. 0.201 1.026 ↓ 1.1 213 1

Hash Left Join (cost=2.79..107.45 rows=202 width=1,733) (actual time=0.104..1.026 rows=213 loops=1)

  • Hash Cond: (core_offer.currency_id = core_currency.id)
17. 0.769 0.769 ↓ 1.1 213 1

Seq Scan on core_offer (cost=0.00..102.04 rows=202 width=1,626) (actual time=0.028..0.769 rows=213 loops=1)

  • Filter: (is_active AND (publish_dt <= '2019-02-06 16:54:29.038713+00'::timestamp with time zone) AND ((disabled_until_dt IS NULL) OR (disabled_until_dt < '2019-02-06 16:54:29.039022+00'::timestamp with time zone)) AND ((advertisement_type)::text = 'STANDARD'::text))
  • Rows Removed by Filter: 75
18. 0.029 0.056 ↑ 1.0 35 1

Hash (cost=2.35..2.35 rows=35 width=107) (actual time=0.056..0.056 rows=35 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
19. 0.027 0.027 ↑ 1.0 35 1

Seq Scan on core_currency (cost=0.00..2.35 rows=35 width=107) (actual time=0.009..0.027 rows=35 loops=1)

20. 0.034 0.058 ↓ 1.4 78 1

Hash (cost=1.55..1.55 rows=55 width=540) (actual time=0.058..0.058 rows=78 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
21. 0.024 0.024 ↓ 1.4 78 1

Seq Scan on core_publisher (cost=0.00..1.55 rows=55 width=540) (actual time=0.006..0.024 rows=78 loops=1)

22. 0.852 0.852 ↑ 1.0 1 213

Index Scan using core_user_pkey on core_user t9 (cost=0.28..4.32 rows=1 width=467) (actual time=0.004..0.004 rows=1 loops=213)

  • Index Cond: (id = core_offer.advertiser_id)