explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xRLG : TP_query

Settings
# exclusive inclusive rows x rows loops node
1. 43.444 2,941.477 ↓ 9.6 145,877 1

Unique (cost=76,939.70..77,394.32 rows=15,154 width=165) (actual time=2,885.350..2,941.477 rows=145,877 loops=1)

2. 657.095 2,898.033 ↓ 10.0 151,537 1

Sort (cost=76,939.70..76,977.58 rows=15,154 width=165) (actual time=2,885.349..2,898.033 rows=151,537 loops=1)

  • Sort Key: b.brand, list_x_prd_post1.list_name, list_x_prd_post1.product_code DESC, (string_agg((CASE WHEN ((list_x_prd_post1.alternate_product)::text = ' '::text) THEN NULL::character varying ELSE list_x_prd_post1.alternate_product END)::text, ','::text ORDER BY list_x_prd_post1.alternate_product)), (string_agg((CASE WHEN (list_x_prd_post1.alt_cd_mpq = ' '::bpchar) THEN NULL::bpchar ELSE list_x_prd_post1.alt_cd_mpq END)::text, ','::text ORDER BY list_x_prd_post1.alt_cd_mpq)), (string_agg((CASE WHEN (list_x_prd_post1.alt_cd_trigger = ' '::bpchar) THEN NULL::bpchar ELSE list_x_prd_post1.alt_cd_trigger END)::text, ','::text ORDER BY list_x_prd_post1.alt_cd_trigger)), b.owner_name, b.nationality, b.list_type, b.mpq, b.trigger_level
  • Sort Method: quicksort Memory: 27,704kB
3. 99.393 2,240.938 ↓ 10.0 151,537 1

Hash Left Join (cost=61,641.03..75,887.45 rows=15,154 width=165) (actual time=899.297..2,240.938 rows=151,537 loops=1)

  • Hash Cond: (((list_x_prd_post1.list_name)::text = (b.list_name)::text) AND ((list_x_prd_post1.product_code)::text = (b.product_code)::text))
4. 1,184.338 2,038.028 ↓ 9.6 145,433 1

GroupAggregate (cost=36,203.61..40,636.07 rows=15,154 width=127) (actual time=795.513..2,038.028 rows=145,433 loops=1)

  • Group Key: list_x_prd_post1.list_name, list_x_prd_post1.product_code
5. 799.548 853.690 ↑ 1.0 151,537 1

Sort (cost=36,203.61..36,582.45 rows=151,537 width=1,064) (actual time=795.458..853.690 rows=151,537 loops=1)

  • Sort Key: list_x_prd_post1.list_name, list_x_prd_post1.product_code
  • Sort Method: quicksort Memory: 311,586kB
6. 54.142 54.142 ↑ 1.0 151,537 1

Seq Scan on list_x_prd_post1 (cost=0.00..23,164.37 rows=151,537 width=1,064) (actual time=0.008..54.142 rows=151,537 loops=1)

7. 46.997 103.517 ↑ 1.0 151,537 1

Hash (cost=23,164.37..23,164.37 rows=151,537 width=69) (actual time=103.517..103.517 rows=151,537 loops=1)

  • Buckets: 262,144 Batches: 1 Memory Usage: 17,197kB
8. 56.520 56.520 ↑ 1.0 151,537 1

Seq Scan on list_x_prd_post1 b (cost=0.00..23,164.37 rows=151,537 width=69) (actual time=0.019..56.520 rows=151,537 loops=1)