explain.depesz.com

PostgreSQL's explain analyze made readable

Result: lieP

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

Finalize Aggregate (cost=63,178.38..63,178.39 rows=1 width=32) (actual time=2,593.305..2,593.305 rows=1 loops=1)

2. 6.509 2,593.864 ↓ 1.5 3 1

Gather (cost=63,178.15..63,178.36 rows=2 width=32) (actual time=2,591.516..2,593.864 rows=3 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 248.317 2,587.355 ↑ 1.0 1 3 / 3

Partial Aggregate (cost=62,178.15..62,178.16 rows=1 width=32) (actual time=2,587.355..2,587.355 rows=1 loops=3)

4. 168.740 2,339.038 ↓ 79.9 268,178 3 / 3

Hash Join (cost=356.63..62,152.98 rows=3,356 width=9) (actual time=41.152..2,339.038 rows=268,178 loops=3)

  • Hash Cond: (sit.storeid = usp.storeid)
5. 405.001 2,170.236 ↓ 45.0 268,178 3 / 3

Nested Loop (cost=349.24..62,126.82 rows=5,965 width=41) (actual time=41.037..2,170.236 rows=268,178 loops=3)

6. 142.096 156.167 ↓ 29.2 268,178 3 / 3

Parallel Bitmap Heap Scan on stockitemtransaction sit (cost=348.68..29,958.64 rows=9,197 width=44) (actual time=41.004..156.167 rows=268,178 loops=3)

  • Recheck Cond: (((transactiontime)::date >= '2020-01-01'::date) AND ((transactiontime)::date <= '2020-01-31'::date) AND (transactiontype = 2))
  • Heap Blocks: exact=5216
7. 14.071 14.071 ↓ 36.4 804,534 1 / 3

Bitmap Index Scan on ix_stockitemtransaction_transactiontime_cast (cost=0.00..343.16 rows=22,073 width=0) (actual time=42.214..42.214 rows=804,534 loops=1)

  • Index Cond: (((transactiontime)::date >= '2020-01-01'::date) AND ((transactiontime)::date <= '2020-01-31'::date))
8. 1,609.068 1,609.068 ↑ 1.0 1 804,534 / 3

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

  • Index Cond: ((stockitemid = sit.stockitemid) AND (storeid = sit.storeid) AND (calculationdate = (sit.transactiontime)::date))
9. 0.013 0.062 ↑ 1.0 22 3 / 3

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

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
10. 0.049 0.049 ↑ 1.0 22 3 / 3

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

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