explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nD84

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 242.857 ↑ 1.0 1 1

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

2. 8.185 243.008 ↓ 1.5 3 1

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

  • Workers Planned: 2
  • Workers Launched: 2
3. 28.944 234.823 ↑ 1.0 1 3 / 3

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

4. 14.421 205.879 ↓ 6.3 20,977 3 / 3

Hash Join (cost=356.63..62,152.98 rows=3,356 width=9) (actual time=2.965..205.879 rows=20,977 loops=3)

  • Hash Cond: (sit.storeid = usp.storeid)
5. 34.876 191.383 ↓ 3.5 20,977 3 / 3

Nested Loop (cost=349.24..62,126.82 rows=5,965 width=41) (actual time=2.833..191.383 rows=20,977 loops=3)

6. 8.155 9.668 ↓ 2.3 20,977 3 / 3

Parallel Bitmap Heap Scan on stockitemtransaction sit (cost=348.68..29,958.64 rows=9,197 width=44) (actual time=2.807..9.668 rows=20,977 loops=3)

  • Recheck Cond: (((transactiontime)::date >= '2020-01-01'::date) AND ((transactiontime)::date <= '2020-01-02'::date) AND (transactiontype = 2))
  • Heap Blocks: exact=534
7. 1.513 1.513 ↓ 2.9 62,931 1 / 3

Bitmap Index Scan on ix_stockitemtransaction_transactiontime_cast (cost=0.00..343.16 rows=22,073 width=0) (actual time=4.539..4.539 rows=62,931 loops=1)

  • Index Cond: (((transactiontime)::date >= '2020-01-01'::date) AND ((transactiontime)::date <= '2020-01-02'::date))
8. 146.839 146.839 ↑ 1.0 1 62,931 / 3

Index Scan using dailytotals_storeid_stockitemid_calculationdate_uq on dailytotals dt (cost=0.56..3.50 rows=1 width=41) (actual time=0.007..0.007 rows=1 loops=62,931)

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

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

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

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

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