explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FHMT

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 6.989 ↑ 1.0 20 1

Limit (cost=442.55..442.60 rows=20 width=149) (actual time=6.984..6.989 rows=20 loops=1)

2. 0.780 6.985 ↑ 59.8 20 1

Sort (cost=442.55..445.54 rows=1,196 width=149) (actual time=6.983..6.985 rows=20 loops=1)

  • Sort Key: bed.batch_end
  • Sort Method: top-N heapsort Memory: 30kB
3. 0.643 6.205 ↓ 1.0 1,210 1

Hash Left Join (cost=359.93..410.73 rows=1,196 width=149) (actual time=5.297..6.205 rows=1,210 loops=1)

  • Hash Cond: (fraud_data.campaign_id = bed.campaign_id)
4. 0.291 0.291 ↓ 1.0 1,210 1

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

5. 0.220 5.271 ↓ 2.0 1,096 1

Hash (cost=353.24..353.24 rows=535 width=24) (actual time=5.271..5.271 rows=1,096 loops=1)

  • Buckets: 2,048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 76kB
6. 0.128 5.051 ↓ 2.0 1,096 1

Subquery Scan on bed (cost=345.11..353.24 rows=535 width=24) (actual time=4.578..5.051 rows=1,096 loops=1)

7. 0.237 4.923 ↓ 2.0 1,096 1

Unique (cost=345.11..347.89 rows=535 width=29) (actual time=4.577..4.923 rows=1,096 loops=1)

8. 0.909 4.686 ↓ 3.2 1,792 1

Sort (cost=345.11..346.50 rows=556 width=29) (actual time=4.576..4.686 rows=1,792 loops=1)

  • Sort Key: batch.campaign_id, batch.charging DESC, batch.batch_number
  • Sort Method: quicksort Memory: 189kB
9. 3.509 3.777 ↓ 3.2 1,792 1

Bitmap Heap Scan on batch (cost=54.30..319.76 rows=556 width=29) (actual time=0.302..3.777 rows=1,792 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: 28
  • Heap Blocks: exact=246
10. 0.001 0.268 ↓ 0.0 0 1

BitmapOr (cost=54.30..54.30 rows=573 width=0) (actual time=0.268..0.268 rows=0 loops=1)

11. 0.240 0.240 ↓ 3.2 1,786 1

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

  • Index Cond: ((total_products_sold > 0) AND (charging = true))
12. 0.027 0.027 ↓ 2.5 55 1

Bitmap Index Scan on batch__batch_end (cost=0.00..4.45 rows=22 width=0) (actual time=0.027..0.027 rows=55 loops=1)

  • Index Cond: (batch_end > ('now'::cstring)::date)