explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DRkH

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

Limit (cost=394.08..394.13 rows=20 width=44) (actual time=6.250..6.256 rows=20 loops=1)

2. 0.187 6.251 ↑ 9.2 20 1

Sort (cost=394.08..394.55 rows=185 width=44) (actual time=6.249..6.251 rows=20 loops=1)

  • Sort Key: ccc.batch_end
  • Sort Method: top-N heapsort Memory: 26kB
3. 0.121 6.064 ↓ 5.9 1,091 1

Subquery Scan on ccc (cost=386.39..389.16 rows=185 width=44) (actual time=5.535..6.064 rows=1,091 loops=1)

4. 0.239 5.943 ↓ 5.9 1,091 1

Unique (cost=386.39..387.31 rows=185 width=49) (actual time=5.534..5.943 rows=1,091 loops=1)

5. 1.444 5.704 ↓ 9.7 1,786 1

Sort (cost=386.39..386.85 rows=185 width=49) (actual time=5.533..5.704 rows=1,786 loops=1)

  • Sort Key: batch.campaign_id, batch.charging DESC, batch.batch_number
  • Sort Method: quicksort Memory: 300kB
6. 0.885 4.260 ↓ 9.7 1,786 1

Hash Join (cost=110.19..379.42 rows=185 width=49) (actual time=0.965..4.260 rows=1,786 loops=1)

  • Hash Cond: (batch.campaign_id = fd.campaign_id)
7. 2.482 2.804 ↓ 3.2 1,790 1

Bitmap Heap Scan on batch (cost=54.28..319.58 rows=555 width=29) (actual time=0.379..2.804 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
8. 0.001 0.322 ↓ 0.0 0 1

BitmapOr (cost=54.28..54.28 rows=565 width=0) (actual time=0.322..0.322 rows=0 loops=1)

9. 0.296 0.296 ↓ 3.2 1,788 1

Bitmap Index Scan on "batch__tps-charging" (cost=0.00..49.62 rows=552 width=0) (actual time=0.295..0.296 rows=1,788 loops=1)

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

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

  • Index Cond: (batch_end > ('now'::cstring)::date)
11. 0.250 0.571 ↓ 1.0 1,210 1

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

  • Buckets: 2,048 Batches: 1 Memory Usage: 92kB
12. 0.321 0.321 ↓ 1.0 1,210 1

Seq Scan on fraud_data fd (cost=0.00..40.96 rows=1,196 width=32) (actual time=0.017..0.321 rows=1,210 loops=1)

Planning time : 0.691 ms
Execution time : 6.327 ms