explain.depesz.com

PostgreSQL's explain analyze made readable

Result: V0sY

Settings
# exclusive inclusive rows x rows loops node
1. 16,124.670 16,124.670 ↑ 302.6 60,354 1

CTE Scan on z (cost=2,585,124.79..2,950,379.35 rows=18,262,728 width=464) (actual time=635.343..16,124.670 rows=60,354 loops=1)

2.          

CTE x

3. 101.933 101.933 ↓ 1.0 60,582 1

Index Scan using rtb_ssp_log_created_at_idx on rtb_ssp_log (cost=0.43..61,429.38 rows=59,922 width=1,238) (actual time=3.895..101.933 rows=60,582 loops=1)

  • Index Cond: ((created_at >= '2019-06-10 11:32:55+00'::timestamp with time zone) AND (created_at < '2019-06-10 11:33:00+00'::timestamp with time zone))
4.          

CTE y

5. 72.876 169.831 ↑ 1.0 60,558 1

Gather (cost=1,000.00..41,521.18 rows=60,955 width=109) (actual time=14.166..169.831 rows=60,558 loops=1)

  • Workers Planned: 3
  • Workers Launched: 3
6. 96.955 96.955 ↑ 1.3 15,140 4

Parallel Seq Scan on rtb_dsp_log (cost=0.00..34,425.68 rows=19,663 width=109) (actual time=5.761..96.955 rows=15,140 loops=4)

  • Filter: ((created_at >= '2019-06-10 11:32:55+00'::timestamp with time zone) AND (created_at < '2019-06-10 11:33:00+00'::timestamp with time zone))
  • Rows Removed by Filter: 434860
7.          

CTE z

8. 15,199.862 15,943.895 ↑ 302.6 60,354 1

Merge Join (cost=16,253.96..2,482,174.24 rows=18,262,728 width=464) (actual time=635.339..15,943.895 rows=60,354 loops=1)

  • Merge Cond: (x.id = y.ssp_log_id)
9. 219.575 440.697 ↓ 1.0 60,582 1

Sort (cost=8,058.54..8,208.35 rows=59,922 width=104) (actual time=359.438..440.697 rows=60,582 loops=1)

  • Sort Key: x.id
  • Sort Method: external merge Disk: 75304kB
10. 18.976 221.122 ↓ 1.0 60,582 1

Hash Join (cost=25.98..1,382.64 rows=59,922 width=104) (actual time=3.937..221.122 rows=60,582 loops=1)

  • Hash Cond: (x.ssp_id = rtb_ssp.id)
11. 202.131 202.131 ↓ 1.0 60,582 1

CTE Scan on x (cost=0.00..1,198.44 rows=59,922 width=72) (actual time=3.899..202.131 rows=60,582 loops=1)

12. 0.005 0.015 ↑ 236.7 3 1

Hash (cost=17.10..17.10 rows=710 width=48) (actual time=0.015..0.015 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
13. 0.010 0.010 ↑ 236.7 3 1

Seq Scan on rtb_ssp (cost=0.00..17.10 rows=710 width=48) (actual time=0.009..0.010 rows=3 loops=1)

14. 10.579 303.336 ↑ 1.0 60,558 1

Materialize (cost=8,195.42..8,500.19 rows=60,955 width=97) (actual time=275.633..303.336 rows=60,558 loops=1)

15. 72.065 292.757 ↑ 1.0 60,558 1

Sort (cost=8,195.42..8,347.81 rows=60,955 width=97) (actual time=275.629..292.757 rows=60,558 loops=1)

  • Sort Key: y.ssp_log_id
  • Sort Method: external merge Disk: 3680kB
16. 18.144 220.692 ↑ 1.0 60,558 1

Hash Join (cost=15.18..1,397.23 rows=60,955 width=97) (actual time=14.198..220.692 rows=60,558 loops=1)

  • Hash Cond: (y.dsp_id = rtb_dsp.id)
17. 202.536 202.536 ↑ 1.0 60,558 1

CTE Scan on y (cost=0.00..1,219.10 rows=60,955 width=65) (actual time=14.170..202.536 rows=60,558 loops=1)

18. 0.003 0.012 ↑ 76.7 3 1

Hash (cost=12.30..12.30 rows=230 width=48) (actual time=0.012..0.012 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
19. 0.009 0.009 ↑ 76.7 3 1

Seq Scan on rtb_dsp (cost=0.00..12.30 rows=230 width=48) (actual time=0.009..0.009 rows=3 loops=1)

Planning time : 0.650 ms
Execution time : 16,171.100 ms