explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4Z24

Settings
# exclusive inclusive rows x rows loops node
1. 3,057.694 125,125.615 ↑ 2.7 2,945,820 1

Unique (cost=3,839,981.25..3,958,567.16 rows=7,905,727 width=68) (actual time=117,220.613..125,125.615 rows=2,945,820 loops=1)

2. 9,626.863 122,067.921 ↑ 1.3 5,891,640 1

Sort (cost=3,839,981.25..3,859,745.57 rows=7,905,727 width=68) (actual time=117,220.613..122,067.921 rows=5,891,640 loops=1)

  • Sort Key: user_has_review.id, user_has_review.id_brand, user_has_review.created_at, user_has_review.updated_at, user_has_review.stats
  • Sort Method: external merge Disk: 718152kB
3. 519.172 112,441.058 ↑ 1.3 5,891,640 1

Append (cost=0.00..2,744,279.36 rows=7,905,727 width=68) (actual time=6.769..112,441.058 rows=5,891,640 loops=1)

4. 15,825.762 15,825.762 ↑ 1.2 2,945,820 1

Seq Scan on user_has_review (cost=0.00..569,576.62 rows=3,608,408 width=102) (actual time=6.768..15,825.762 rows=2,945,820 loops=1)

  • Filter: (active AND (updated_at > '1970-01-01 00:00:00'::timestamp without time zone) AND (id_brand = 'AC'::bpchar))
  • Rows Removed by Filter: 513499
5. 3,605.813 96,096.124 ↑ 1.5 2,945,820 1

Gather (cost=661,478.54..2,095,645.47 rows=4,297,319 width=102) (actual time=3,102.107..96,096.124 rows=2,945,820 loops=1)

  • Workers Planned: 7
  • Workers Launched: 7
6. 25,571.250 92,490.311 ↑ 1.7 368,228 8

Hash Join (cost=660,478.54..1,664,913.57 rows=613,903 width=102) (actual time=4,771.503..92,490.311 rows=368,228 loops=8)

  • Hash Cond: (user_has_rating.id = user_has_review_1.id)
7. 62,303.619 62,303.619 ↑ 1.1 5,144,268 8

Parallel Seq Scan on user_has_rating (cost=0.00..875,155.49 rows=5,882,872 width=11) (actual time=4.252..62,303.619 rows=5,144,268 loops=8)

  • Filter: (active AND (updated_at > '1970-01-01 00:00:00'::timestamp without time zone) AND (id_brand = 'AC'::bpchar))
  • Rows Removed by Filter: 755016
8. 1,873.046 4,615.442 ↑ 1.2 2,945,820 8

Hash (cost=558,982.19..558,982.19 rows=3,608,748 width=102) (actual time=4,615.442..4,615.442 rows=2,945,820 loops=8)

  • Buckets: 1048576 Batches: 4 Memory Usage: 113638kB
9. 2,742.396 2,742.396 ↑ 1.2 2,945,820 8

Seq Scan on user_has_review user_has_review_1 (cost=0.00..558,982.19 rows=3,608,748 width=102) (actual time=0.050..2,742.396 rows=2,945,820 loops=8)

  • Filter: (active AND (id_brand = 'AC'::bpchar))
  • Rows Removed by Filter: 513499