explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ETfb : Optimization for: plan #PCoD

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 441.418 9,656.621 ↓ 3.7 487,042 1

Gather (cost=757,951.65..909,395.27 rows=133,432 width=4) (actual time=8,901.761..9,656.621 rows=487,042 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
2. 446.878 9,215.203 ↓ 2.9 162,347 3

Parallel Hash Join (cost=756,951.65..895,052.07 rows=55,597 width=4) (actual time=8,871.648..9,215.203 rows=162,347 loops=3)

  • Hash Cond: (stores_customer.id = campaigns_campaignaudience.subscriber_id)
3. 625.119 625.119 ↑ 1.3 352,392 3

Parallel Seq Scan on stores_customer (cost=0.00..131,722.54 rows=441,821 width=4) (actual time=0.120..625.119 rows=352,392 loops=3)

  • Filter: (store_id = 22)
  • Rows Removed by Filter: 210139
4. 205.376 8,143.206 ↓ 2.6 504,789 3

Parallel Hash (cost=753,761.19..753,761.19 rows=194,437 width=8) (actual time=8,143.206..8,143.206 rows=504,789 loops=3)

  • Buckets: 131072 (originally 131072) Batches: 16 (originally 8) Memory Usage: 4864kB
5. 4,786.705 7,937.830 ↓ 2.6 504,789 3

Parallel Hash Join (cost=76,359.73..753,761.19 rows=194,437 width=8) (actual time=4,903.318..7,937.830 rows=504,789 loops=3)

  • Hash Cond: ((campaigns_campaignaudience.subscriber_id = reports_campaigncustomerstats.customer_id) AND (campaigns_campaignaudience.campaign_id = reports_campaigncustomerstats.campaign_id))
  • Join Filter: (((reports_campaigncustomerstats.click_events_count > 0) AND (campaigns_campaignaudience.send_time > '2019-04-08 16:45:09.089968+03'::timestamp with time zone)) OR ((reports_campaigncustomerstats.initial_open_events_count > 0) AND (campaigns_campaignaudience.send_time > '2019-07-08 16:45:09.089968+03'::timestamp with time zone)))
  • Rows Removed by Join Filter: 144744
6. 2,622.238 2,622.238 ↑ 1.3 8,522,778 3

Parallel Seq Scan on campaigns_campaignaudience (cost=0.00..512,666.73 rows=10,653,473 width=16) (actual time=0.368..2,622.238 rows=8,522,778 loops=3)

7. 241.447 528.887 ↑ 1.3 773,151 3

Parallel Hash (cost=56,952.75..56,952.75 rows=976,065 width=16) (actual time=528.887..528.887 rows=773,151 loops=3)

  • Buckets: 131072 Batches: 64 Memory Usage: 2784kB
8. 287.440 287.440 ↑ 1.3 773,151 3

Parallel Seq Scan on reports_campaigncustomerstats (cost=0.00..56,952.75 rows=976,065 width=16) (actual time=0.082..287.440 rows=773,151 loops=3)

  • Filter: ((click_events_count > 0) OR (initial_open_events_count > 0))
  • Rows Removed by Filter: 247742
Planning time : 2.240 ms