alamb commented on PR #25811:
URL: https://github.com/apache/datafusion/pull/25811#issuecomment-7114084354
I also ran a small benchmark locally reading from s3
This PR ran the query in 1.5s or less, while the main branch takes 3.2s. So
🚀
Here is the testing method:
Created a file with bloom filters
```sql
COPY (SELECT * FROM 'benchmarks/data/hits.parquet')
TO 'hits_bloom.parquet' OPTIONS (
'format.bloom_filter_enabled::UserID' 'true',
'format.bloom_filter_enabled::URLHash' 'true',
'format.bloom_filter_enabled::RefererHash' 'true',
'format.bloom_filter_enabled::WatchID' 'true',
'format.bloom_filter_enabled::IsRefresh' 'true',
'format.bloom_filter_enabled::DontCountHits' 'true',
'format.bloom_filter_ndv' '1000000'
);
```
Write to s3
```shell
aws s3 cp ~/Downloads/hits_bloom.parquet s3://alamb-dev/hits_bloom.parquet
```
Then I ran main and this branch, release branch, using this (my local aws
connection maxes out at 42MB/s):
```shell
datafusion-cli -f /Users/andrewlamb/Downloads/bloom_bench.sql
```
bloom_bench.sql:
```sql
CREATE EXTERNAL TABLE hits
STORED AS PARQUET
LOCATION 's3://alamb-dev/hits_bloom.parquet'
OPTIONS ('aws.region' 'us-east-1');
-- Warm up: loads and caches the parquet footer
SELECT count(*) FROM hits;
-- Q1 selective filters first: UserID keeps 4 of 96 row groups, ClientIP 2,
URLHash 40, RefererHash 96
SELECT count(*) FROM hits WHERE "UserID" = 435090932899640449 AND "ClientIP"
= -1929374775 AND "URLHash" = -6657861389198619947 AND "RefererHash" =
8981252764048837684;
SELECT count(*) FROM hits WHERE "UserID" = 435090932899640449 AND "ClientIP"
= -1929374775 AND "URLHash" = -6657861389198619947 AND "RefererHash" =
8981252764048837684;
SELECT count(*) FROM hits WHERE "UserID" = 435090932899640449 AND "ClientIP"
= -1929374775 AND "URLHash" = -6657861389198619947 AND "RefererHash" =
8981252764048837684;
```
Results:
<details>
```
andrewlamb@Andrews-MacBook-Pro-3:~/Software/datafusion$
~/Downloads/datafusion-cli-fix_incremental-bloom-filter-pruning -f
~/Downloads/bloom_bench.sql
DataFusion CLI v57.0.0-dev
0 row(s) fetched.
Elapsed 1.177 seconds.
+----------+
| count(*) |
+----------+
| 99997497 |
+----------+
1 row(s) fetched.
Elapsed 0.047 seconds.
+----------+
| count(*) |
+----------+
| 1 |
+----------+
1 row(s) fetched.
Elapsed 1.513 seconds.
+----------+
| count(*) |
+----------+
| 1 |
+----------+
1 row(s) fetched.
Elapsed 1.328 seconds.
+----------+
| count(*) |
+----------+
| 1 |
+----------+
1 row(s) fetched.
Elapsed 1.522 seconds.
andrewlamb@Andrews-MacBook-Pro-3:~/Software/datafusion$ datafusion-cli -f
/Users/andrewlamb/Downloads/bloom_bench.sql
DataFusion CLI v57.0.0-dev
0 row(s) fetched.
Elapsed 1.160 seconds.
+----------+
| count(*) |
+----------+
| 99997497 |
+----------+
1 row(s) fetched.
Elapsed 0.044 seconds.
+----------+
| count(*) |
+----------+
| 1 |
+----------+
1 row(s) fetched.
Elapsed 3.607 seconds.
+----------+
| count(*) |
+----------+
| 1 |
+----------+
1 row(s) fetched.
Elapsed 4.036 seconds.
+----------+
| count(*) |
+----------+
| 1 |
+----------+
1 row(s) fetched.
Elapsed 3.672 seconds.
```
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]