explain.depesz.com

PostgreSQL's explain analyze made readable

Result: y5Ie

Settings
# exclusive inclusive rows x rows loops node
1. 0.532 9,499.225 ↓ 5.5 1,142 1

Sort (cost=536,172.92..536,173.44 rows=207 width=60) (actual time=9,499.106..9,499.225 rows=1,142 loops=1)

  • Sort Key: (sum(CASE WHEN (stat.created > (CURRENT_DATE - 14)) THEN stat.diff_tx ELSE 0 END))
  • Sort Method: quicksort Memory: 209kB
  • Functions: 54
  • Options: Inlining true, Optimization true, Expressions true, Deforming true
  • Timing: Generation 22.956 ms, Inlining 510.172 ms, Optimization 1317.583 ms, Emission 861.661 ms, Total 2712.372 ms
2. 0.000 9,498.693 ↓ 5.5 1,142 1

Finalize GroupAggregate (cost=536,134.34..536,164.95 rows=207 width=60) (actual time=9,495.702..9,498.693 rows=1,142 loops=1)

  • Group Key: stat.product_id
3. 65.660 9,513.888 ↓ 11.1 1,916 1

Gather Merge (cost=536,134.34..536,159.36 rows=172 width=52) (actual time=9,495.691..9,513.888 rows=1,916 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
4. 1.041 9,448.228 ↓ 7.4 639 3 / 3

Partial GroupAggregate (cost=535,134.32..535,139.48 rows=86 width=52) (actual time=9,447.002..9,448.228 rows=639 loops=3)

  • Group Key: stat.product_id
5. 1.083 9,447.187 ↓ 10.8 931 3 / 3

Sort (cost=535,134.32..535,134.54 rows=86 width=20) (actual time=9,446.973..9,447.187 rows=931 loops=3)

  • Sort Key: stat.product_id
  • Sort Method: quicksort Memory: 95kB
  • Worker 0: Sort Method: quicksort Memory: 100kB
  • Worker 1: Sort Method: quicksort Memory: 97kB
6. 156.510 9,446.104 ↓ 10.8 931 3 / 3

Parallel Hash Join (cost=496,855.51..535,131.56 rows=86 width=20) (actual time=8,792.188..9,446.104 rows=931 loops=3)

  • Hash Cond: (stat.product_id = product.itemid)
7. 501.927 501.927 ↑ 1.2 732,684 3 / 3

Parallel Seq Scan on stat (cost=0.00..35,033.59 rows=864,559 width=20) (actual time=2.920..501.927 rows=732,684 loops=3)

8. 2,046.263 8,787.667 ↓ 11.0 1,289 3 / 3

Parallel Hash (cost=496,854.05..496,854.05 rows=117 width=4) (actual time=8,787.666..8,787.667 rows=1,289 loops=3)

  • Buckets: 4,096 (originally 1024) Batches: 1 (originally 1) Memory Usage: 280kB
9. 6,741.404 6,741.404 ↓ 11.0 1,289 3 / 3

Parallel Seq Scan on product (cost=0.00..496,854.05 rows=117 width=4) (actual time=912.193..6,741.404 rows=1,289 loops=3)

  • Filter: ((name)::text ~~ '%blue%'::text)
  • Rows Removed by Filter: 930,911
Execution time : 9,517.683 ms