explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9qb4

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

GroupAggregate (cost=59,261.53..59,266.19 rows=133 width=96) (actual rows= loops=)

  • Group Key: b.pm_brand
2.          

CTE a

3. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=32,159.73..59,247.20 rows=133 width=113) (actual rows= loops=)

  • Hash Cond: (((date_part('year'::text, (u.date)::timestamp without time zone)) = (tr.year)::double precision) AND (u.media = tr.media))
4. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=32,136.92..59,220.87 rows=133 width=77) (actual rows= loops=)

  • Hash Cond: (u.medium = prudential_channel_group.channel)
5.          

CTE u

6. 0.000 0.000 ↓ 0.0

Append (cost=0.00..31,286.32 rows=984,066 width=60) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 1 (cost=0.00..31,196.56 rows=982,128 width=60) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Seq Scan on prudential_data_table g (cost=0.00..21,375.28 rows=982,128 width=60) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Seq Scan on prudential_data_2019_h1 h (cost=0.00..70.38 rows=1,938 width=184) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Hash Join (cost=844.57..27,926.17 rows=133 width=109) (actual rows= loops=)

  • Hash Cond: (u.audiocode = slownik.audiocode)
11. 0.000 0.000 ↓ 0.0

CTE Scan on u (cost=0.00..27,061.82 rows=4,920 width=80) (actual rows= loops=)

  • Filter: (date_part('year'::text, (date)::timestamp without time zone) = '2018'::double precision)
12. 0.000 0.000 ↓ 0.0

Hash (cost=838.05..838.05 rows=522 width=37) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Seq Scan on slownik_prudential slownik (cost=0.00..838.05 rows=522 width=37) (actual rows= loops=)

  • Filter: ((pm_include > 0) AND (pm_category = 'UBEZPIECZENIA'::text) AND (pm_subcategory = 'WIZERUNEK'::text))
14. 0.000 0.000 ↓ 0.0

Hash (cost=3.79..3.79 rows=179 width=11) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Seq Scan on prudential_channel_group (cost=0.00..3.79 rows=179 width=11) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Hash (cost=22.75..22.75 rows=4 width=68) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Seq Scan on tabela_rabaty tr (cost=0.00..22.75 rows=4 width=68) (actual rows= loops=)

  • Filter: ((year)::double precision = '2018'::double precision)
18.          

CTE b

19. 0.000 0.000 ↓ 0.0

WindowAgg (cost=0.00..6.98 rows=133 width=72) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

CTE Scan on a (cost=0.00..2.66 rows=133 width=72) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Sort (cost=7.35..7.68 rows=133 width=96) (actual rows= loops=)

  • Sort Key: b.pm_brand
22. 0.000 0.000 ↓ 0.0

CTE Scan on b (cost=0.00..2.66 rows=133 width=96) (actual rows= loops=)