explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gF4x

Settings
# exclusive inclusive rows x rows loops node
1. 0.011 148,786.178 ↑ 1.0 100 1

Limit (cost=1,316,143.47..1,316,155.66 rows=100 width=474) (actual time=148,410.950..148,786.178 rows=100 loops=1)

2. 0.000 148,786.167 ↑ 35,741.1 100 1

Gather Merge (cost=1,316,143.47..1,752,018.48 rows=3,574,110 width=474) (actual time=148,410.949..148,786.167 rows=100 loops=1)

  • Workers Planned: 6
  • Workers Launched: 6
3. 6,103.111 1,038,219.889 ↑ 4,964.0 120 7

Sort (cost=1,315,143.37..1,316,632.58 rows=595,685 width=474) (actual time=148,317.082..148,317.127 rows=120 loops=7)

  • Sort Key: user_has_review.created_at DESC
  • Sort Method: external merge Disk: 213808kB
4. 4,356.978 1,032,116.778 ↑ 1.4 420,836 7

Nested Loop (cost=0.56..1,182,874.25 rows=595,685 width=474) (actual time=33.471..147,445.254 rows=420,836 loops=7)

5. 108,653.664 108,653.664 ↑ 1.2 420,836 7

Parallel Seq Scan on user_has_review (cost=0.00..720,718.99 rows=490,484 width=475) (actual time=5.015..15,521.952 rows=420,836 loops=7)

  • Filter: (active AND (id_brand = 'AC'::bpchar))
  • Rows Removed by Filter: 73357
6. 919,106.136 919,106.136 ↑ 1.0 1 2,945,853

Index Scan using user_has_rating_pkey on user_has_rating (cost=0.56..0.94 rows=1 width=13) (actual time=0.312..0.312 rows=1 loops=2,945,853)

  • Index Cond: ((id = user_has_review.id) AND (id_brand = 'AC'::bpchar))
  • Filter: active