Install Apache Arrow Flight SQL PostgreSQL adapter.
Run PostgreSQL with the following configuration:
shared_preload_libraries = 'arrow_flight_sql'
Prepare database:
psql postgres -c '\i benchmark/integer/prepare1.sql'
It creates afs_benchmark
database and data
table in the database. It also inserts 10M records with random integers to the table.
Run the following programs:
select.rb
: It uses Apache Arrow Flight SQLselect
: It uses PostgreSQL's C APIselect.sql
: You need to use psql
to run thisAll of them just run SELECT * FROM data
.
Here is a benchmark result on the following environment:
100K records:
Apache Arrow Flight SQL | C | psql |
---|---|---|
0.014 | 0.012 | 0.011 |
1M records:
Apache Arrow Flight SQL | C | psql |
---|---|---|
0.069 | 0.116 | 0.107 |
10M records:
Apache Arrow Flight SQL | C | psql |
---|---|---|
0.653 | 1.154 | 1.128 |