explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2zFK

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 2,487.154 ↑ 1.0 1 1

Finalize Aggregate (cost=36,878.46..36,878.47 rows=1 width=32) (actual time=2,487.154..2,487.154 rows=1 loops=1)

  • Buffers: shared hit=4037554
2. 75.565 2,519.112 ↓ 1.5 3 1

Gather (cost=36,878.24..36,878.45 rows=2 width=32) (actual time=2,486.548..2,519.112 rows=3 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
  • Buffers: shared hit=4037554
3. 231.329 2,443.547 ↑ 1.0 1 3 / 3

Partial Aggregate (cost=35,878.24..35,878.25 rows=1 width=32) (actual time=2,443.546..2,443.547 rows=1 loops=3)

  • Buffers: shared hit=4037554
4. 135.620 2,212.218 ↓ 458.4 268,178 3 / 3

Hash Join (cost=7.95..35,873.85 rows=585 width=9) (actual time=1.706..2,212.218 rows=268,178 loops=3)

  • Hash Cond: (sit.storeid = usp.storeid)
  • Buffers: shared hit=4037554
5. 234.090 2,075.147 ↓ 264.2 268,178 3 / 3

Nested Loop (cost=0.56..35,863.26 rows=1,015 width=41) (actual time=0.105..2,075.147 rows=268,178 loops=3)

  • Buffers: shared hit=4037480
6. 231.989 231.989 ↓ 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.033..231.989 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,609.068 1,609.068 ↑ 1.0 1 804,534 / 3

Index Scan using ix_dailytotals_stockitemid_calculationdate_storeid on dailytotals dt (cost=0.56..8.00 rows=1 width=41) (actual time=0.006..0.006 rows=1 loops=804,534)

  • Index Cond: ((stockitemid = sit.stockitemid) AND (calculationdate = (sit.transactiontime)::date) AND (storeid = sit.storeid))
  • Buffers: shared hit=4022672
8. 0.020 1.451 ↑ 1.0 22 3 / 3

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

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

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

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