explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YqE7

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 5.625 ↑ 1.0 20 1

Limit (cost=386.31..386.41 rows=20 width=182) (actual time=5.615..5.625 rows=20 loops=1)

2. 0.003 5.620 ↑ 9.2 20 1

Unique (cost=386.31..387.24 rows=185 width=182) (actual time=5.613..5.620 rows=20 loops=1)

3. 2.293 5.617 ↑ 6.0 31 1

Sort (cost=386.31..386.77 rows=185 width=182) (actual time=5.613..5.617 rows=31 loops=1)

  • Sort Key: batch.campaign_id, batch.charging DESC, batch.batch_number, batch.batch_end
  • Sort Method: quicksort Memory: 523kB
4. 1.014 3.324 ↓ 9.7 1,786 1

Hash Join (cost=110.14..379.34 rows=185 width=182) (actual time=0.908..3.324 rows=1,786 loops=1)

  • Hash Cond: (batch.campaign_id = fd.campaign_id)
5. 1.456 1.710 ↓ 3.2 1,790 1

Bitmap Heap Scan on batch (cost=54.23..319.51 rows=554 width=29) (actual time=0.292..1.710 rows=1,790 loops=1)

  • Recheck Cond: (((total_products_sold > 0) AND charging) OR (batch_end > ('now'::cstring)::date))
  • Filter: ((total_products_sold > 0) AND (charging OR (batch_end > ('now'::cstring)::date)))
  • Rows Removed by Filter: 31
  • Heap Blocks: exact=246
6. 0.000 0.254 ↓ 0.0 0 1

BitmapOr (cost=54.23..54.23 rows=564 width=0) (actual time=0.254..0.254 rows=0 loops=1)

7. 0.241 0.241 ↓ 3.2 1,788 1

Bitmap Index Scan on "batch__tps-charging" (cost=0.00..49.57 rows=551 width=0) (actual time=0.241..0.241 rows=1,788 loops=1)

  • Index Cond: ((total_products_sold > 0) AND (charging = true))
8. 0.013 0.013 ↓ 4.2 51 1

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

  • Index Cond: (batch_end > ('now'::cstring)::date)
9. 0.318 0.600 ↓ 1.0 1,210 1

Hash (cost=40.96..40.96 rows=1,196 width=141) (actual time=0.600..0.600 rows=1,210 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 234kB
10. 0.282 0.282 ↓ 1.0 1,210 1

Seq Scan on fraud_data fd (cost=0.00..40.96 rows=1,196 width=141) (actual time=0.012..0.282 rows=1,210 loops=1)

Planning time : 0.662 ms
Execution time : 5.732 ms