explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9zxn

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

Finalize Aggregate (cost=63,173.92..63,173.93 rows=1 width=32) (actual time=2,446.199..2,446.199 rows=1 loops=1)

  • Buffers: shared hit=4039965
2. 8.939 2,447.491 ↓ 1.5 3 1

Gather (cost=63,173.70..63,173.91 rows=2 width=32) (actual time=2,445.361..2,447.491 rows=3 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
  • Buffers: shared hit=4039965
3. 232.065 2,438.552 ↑ 1.0 1 3 / 3

Partial Aggregate (cost=62,173.70..62,173.71 rows=1 width=32) (actual time=2,438.551..2,438.552 rows=1 loops=3)

  • Buffers: shared hit=4039965
4. 144.869 2,206.487 ↓ 79.9 268,178 3 / 3

Hash Join (cost=352.17..62,148.52 rows=3,356 width=9) (actual time=55.985..2,206.487 rows=268,178 loops=3)

  • Hash Cond: (sit.storeid = usp.storeid)
  • Buffers: shared hit=4039965
5. 309.443 2,061.579 ↓ 45.0 268,178 3 / 3

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

  • Buffers: shared hit=4039894
6. 124.162 143.068 ↓ 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=55.853..143.068 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=5007
  • Buffers: shared hit=17222
7. 18.906 18.906 ↓ 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=56.719..56.719 rows=804,534 loops=1)

  • Index Cond: (((transactiontime)::date >= '2020-01-01'::date) AND ((transactiontime)::date <= '2020-01-31'::date))
  • Buffers: shared hit=2201
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))
  • Buffers: shared hit=4022672
9. 0.010 0.039 ↑ 1.0 22 3 / 3

Hash (cost=2.66..2.66 rows=22 width=16) (actual time=0.039..0.039 rows=22 loops=3)

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

Index Only Scan using ix_test on userstorepermission usp (cost=0.27..2.66 rows=22 width=16) (actual time=0.025..0.029 rows=22 loops=3)

  • Index Cond: (tenantuserid = 'e8dd09bb-cf41-4601-84de-78ff81618612'::uuid)
  • Heap Fetches: 0
  • Buffers: shared hit=11