explain.depesz.com

PostgreSQL's explain analyze made readable

Result: T3Lg

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 3.963 ↑ 1.0 20 1

Limit (cost=380.51..380.56 rows=20 width=28) (actual time=3.960..3.963 rows=20 loops=1)

2. 0.202 3.960 ↑ 26.7 20 1

Sort (cost=380.51..381.85 rows=534 width=28) (actual time=3.960..3.960 rows=20 loops=1)

  • Sort Key: cc.batch_end
  • Sort Method: top-N heapsort Memory: 26kB
3. 0.119 3.758 ↓ 2.1 1,096 1

Subquery Scan on cc (cost=358.19..366.30 rows=534 width=28) (actual time=3.291..3.758 rows=1,096 loops=1)

4. 0.231 3.639 ↓ 2.1 1,096 1

Unique (cost=358.19..360.96 rows=534 width=29) (actual time=3.290..3.639 rows=1,096 loops=1)

5. 0.937 3.408 ↓ 3.2 1,791 1

Sort (cost=358.19..359.58 rows=555 width=29) (actual time=3.289..3.408 rows=1,791 loops=1)

  • Sort Key: batch.campaign_id, batch.charging DESC, batch.batch_number
  • Sort Method: quicksort Memory: 188kB
6. 2.258 2.471 ↓ 3.2 1,791 1

Bitmap Heap Scan on batch (cost=42.49..332.89 rows=555 width=29) (actual time=0.255..2.471 rows=1,791 loops=1)

  • Recheck Cond: (charging OR (batch_end > ('now'::cstring)::date))
  • Filter: ((total_products_sold > 0) AND (charging OR (batch_end > ('now'::cstring)::date)))
  • Rows Removed by Filter: 40
  • Heap Blocks: exact=246
7. 0.001 0.213 ↓ 0.0 0 1

BitmapOr (cost=42.49..42.49 rows=1,820 width=0) (actual time=0.213..0.213 rows=0 loops=1)

8. 0.198 0.198 ↑ 1.0 1,800 1

Bitmap Index Scan on batch__charging (cost=0.00..37.84 rows=1,807 width=0) (actual time=0.198..0.198 rows=1,800 loops=1)

  • Index Cond: (charging = true)
9. 0.014 0.014 ↓ 4.7 56 1

Bitmap Index Scan on batch__batch_end (cost=0.00..4.38 rows=12 width=0) (actual time=0.014..0.014 rows=56 loops=1)

  • Index Cond: (batch_end > ('now'::cstring)::date)
Planning time : 0.298 ms
Execution time : 4.012 ms