explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YUX6

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

Limit (cost=394.01..394.06 rows=20 width=44) (actual time=5.282..5.287 rows=20 loops=1)

2. 0.202 5.282 ↑ 9.2 20 1

Sort (cost=394.01..394.47 rows=185 width=44) (actual time=5.280..5.282 rows=20 loops=1)

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

Subquery Scan on ccc (cost=386.31..389.09 rows=185 width=44) (actual time=4.575..5.080 rows=1,091 loops=1)

4. 0.196 4.933 ↓ 5.9 1,091 1

Unique (cost=386.31..387.24 rows=185 width=49) (actual time=4.574..4.933 rows=1,091 loops=1)

5. 1.093 4.737 ↓ 9.7 1,786 1

Sort (cost=386.31..386.77 rows=185 width=49) (actual time=4.571..4.737 rows=1,786 loops=1)

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

Hash Join (cost=110.14..379.34 rows=185 width=49) (actual time=0.931..3.644 rows=1,786 loops=1)

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

Bitmap Heap Scan on batch (cost=54.23..319.51 rows=554 width=29) (actual time=0.307..2.513 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.003 0.267 ↓ 0.0 0 1

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

9. 0.250 0.250 ↓ 3.2 1,788 1

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

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

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

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

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

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

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

Planning time : 0.756 ms
Execution time : 5.394 ms