explain.depesz.com

PostgreSQL's explain analyze made readable

Result: H5Rc

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 3,679.825 ↑ 1.0 1 1

Finalize Aggregate (cost=32,009.48..32,009.49 rows=1 width=32) (actual time=3,679.825..3,679.825 rows=1 loops=1)

  • Buffers: shared hit=34734
2. 222.581 3,679.924 ↓ 1.5 3 1

Gather (cost=32,009.25..32,009.46 rows=2 width=32) (actual time=3,679.798..3,679.924 rows=3 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
  • Buffers: shared hit=34734
3. 224.982 3,457.343 ↑ 1.0 1 3 / 3

Partial Aggregate (cost=31,009.25..31,009.26 rows=1 width=32) (actual time=3,457.342..3,457.343 rows=1 loops=3)

  • Buffers: shared hit=34734
4. 372.175 3,232.361 ↓ 44,696.3 268,178 3 / 3

Merge Join (cost=30,870.00..31,009.21 rows=6 width=24) (actual time=2,729.447..3,232.361 rows=268,178 loops=3)

  • Merge Cond: ((sit.storeid = usp.storeid) AND (sit.stockitemid = dt.stockitemid) AND (((sit.transactiontime)::date) = dt.calculationdate))
  • Buffers: shared hit=34734
5. 960.512 1,215.363 ↓ 159.9 268,178 3 / 3

Sort (cost=22,536.28..22,540.47 rows=1,677 width=44) (actual time=1,160.746..1,215.363 rows=268,178 loops=3)

  • Sort Key: sit.storeid, sit.stockitemid, ((sit.transactiontime)::date)
  • Sort Method: quicksort Memory: 56758kB
  • Worker 0: Sort Method: quicksort Memory: 39221kB
  • Worker 1: Sort Method: quicksort Memory: 41736kB
  • Buffers: shared hit=14824
6. 254.851 254.851 ↓ 159.9 268,178 3 / 3

Parallel Seq Scan on stockitemtransaction_2 sit (cost=0.00..22,446.46 rows=1,677 width=44) (actual time=0.048..254.851 rows=268,178 loops=3)

  • Filter: ((transactiontype = 2) AND ((transactiontime)::date >= '2020-01-01'::date) AND ((transactiontime)::date <= '2020-01-31'::date))
  • Rows Removed by Filter: 3412
  • Buffers: shared hit=14808
7. 1,291.446 1,644.823 ↓ 56.8 536,743 3 / 3

Sort (cost=8,333.72..8,357.36 rows=9,455 width=72) (actual time=1,568.682..1,644.823 rows=536,743 loops=3)

  • Sort Key: usp.storeid, dt.stockitemid, dt.calculationdate
  • Sort Method: quicksort Memory: 54607kB
  • Worker 0: Sort Method: quicksort Memory: 54607kB
  • Worker 1: Sort Method: quicksort Memory: 54607kB
  • Buffers: shared hit=19910
8. 237.228 353.377 ↓ 31.8 300,930 3 / 3

Hash Join (cost=7.39..7,709.37 rows=9,455 width=72) (actual time=12.036..353.377 rows=300,930 loops=3)

  • Hash Cond: (dt.storeid = usp.storeid)
  • Buffers: shared hit=19910
9. 110.141 110.141 ↓ 3.5 300,930 3 / 3

Seq Scan on dailytotals_2 dt (cost=0.00..7,471.56 rows=85,956 width=56) (actual time=5.761..110.141 rows=300,930 loops=3)

  • Buffers: shared hit=19836
10. 0.031 6.008 ↑ 1.0 22 3 / 3

Hash (cost=7.11..7.11 rows=22 width=16) (actual time=6.008..6.008 rows=22 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
  • Buffers: shared hit=12
11. 5.977 5.977 ↑ 1.0 22 3 / 3

Seq Scan on userstorepermission usp (cost=0.00..7.11 rows=22 width=16) (actual time=5.892..5.977 rows=22 loops=3)

  • Filter: (tenantuserid = 'e8dd09bb-cf41-4601-84de-78ff81618612'::uuid)
  • Rows Removed by Filter: 227
  • Buffers: shared hit=12