explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vqpd

Settings
# exclusive inclusive rows x rows loops node
1. 2,856.993 208,830.476 ↑ 2.7 2,945,820 1

Unique (cost=3,218,434.59..3,337,017.77 rows=7,905,545 width=68) (actual time=198,261.372..208,830.476 rows=2,945,820 loops=1)

2. 13,087.811 205,973.483 ↑ 1.3 5,891,640 1

Sort (cost=3,218,434.59..3,238,198.46 rows=7,905,545 width=68) (actual time=198,261.372..205,973.483 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: 718160kB
3. 498.067 192,885.672 ↑ 1.3 5,891,640 1

Append (cost=0.00..2,122,758.97 rows=7,905,545 width=68) (actual time=0.006..192,885.672 rows=5,891,640 loops=1)

4. 10,609.576 10,609.576 ↑ 1.2 2,945,820 1

Seq Scan on user_has_review (cost=0.00..569,575.17 rows=3,608,325 width=102) (actual time=0.005..10,609.576 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. 288.824 181,778.029 ↑ 1.5 2,945,820 1

Gather (cost=1,000.57..1,474,128.35 rows=4,297,220 width=102) (actual time=7.770..181,778.029 rows=2,945,820 loops=1)

  • Workers Planned: 6
  • Workers Launched: 6
6. 175,846.166 181,489.205 ↑ 1.7 420,831 7

Nested Loop (cost=0.56..1,043,406.35 rows=716,203 width=102) (actual time=12.075..181,489.205 rows=420,831 loops=7)

7. 5,642.622 5,642.622 ↑ 1.4 420,831 7

Parallel Seq Scan on user_has_review user_has_review_1 (cost=0.00..514,838.50 rows=601,444 width=102) (actual time=0.027..5,642.622 rows=420,831 loops=7)

  • Filter: (active AND (id_brand = 'AC'::bpchar))
  • Rows Removed by Filter: 73357
8. 0.417 0.417 ↑ 1.0 1 2,945,820

Index Scan using user_has_rating_pkey on user_has_rating (cost=0.56..0.88 rows=1 width=11) (actual time=0.417..0.417 rows=1 loops=2,945,820)

  • Index Cond: ((id = user_has_review_1.id) AND (id_brand = 'AC'::bpchar))
  • Filter: (active AND (updated_at > '1970-01-01 00:00:00'::timestamp without time zone))