Skip to content

Commit

Permalink
Add SQLite Support (cmu-db#155)
Browse files Browse the repository at this point in the history
TPC-H queries are broken for now.
This also cleans up a bunch of generic DDL issues.
  • Loading branch information
apavlo authored May 30, 2022
1 parent 23498ac commit 01a37b9
Show file tree
Hide file tree
Showing 45 changed files with 1,561 additions and 598 deletions.
54 changes: 52 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
profile: [ 'cockroachdb', 'mariadb', 'mysql', 'postgres', 'spanner', 'phoenix', 'sqlserver' ]
profile: [ 'cockroachdb', 'mariadb', 'mysql', 'postgres', 'spanner', 'phoenix', 'sqlserver', 'sqlite' ]
steps:
- name: Checkout repo
uses: actions/checkout@v2
Expand All @@ -63,6 +63,44 @@ jobs:
name: benchbase-${{matrix.profile}}
path: target/benchbase-${{matrix.profile}}.tgz

## ----------------------------------------------------------------------------------
## SQLITE
## ----------------------------------------------------------------------------------
sqlite:
needs: package-and-upload
runs-on: ubuntu-latest
strategy:
matrix:
# BROKEN: tpch
benchmark: [ 'epinions', 'hyadapt', 'noop', 'resourcestresser', 'seats', 'sibench', 'smallbank', 'tatp', 'tpcc', 'twitter', 'voter', 'wikipedia', 'ycsb' ]
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: benchbase-sqlite

- name: Extract artifact
run: |
tar xvzf benchbase-sqlite.tgz --strip-components=1
- name: Delete artifact
run: |
rm -rf benchbase-sqlite.tgz
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: ${{env.JAVA_VERSION}}
distribution: 'temurin'

- name: Run benchmark
run: |
java -jar benchbase.jar -b ${{matrix.benchmark}} -c config/sqlite/sample_${{matrix.benchmark}}_config.xml --create=true --load=true --execute=true
## ----------------------------------------------------------------------------------
## MARIADB
## ----------------------------------------------------------------------------------
mariadb:
needs: package-and-upload
runs-on: ubuntu-latest
Expand Down Expand Up @@ -111,6 +149,9 @@ jobs:
mysql -h127.0.0.1 -P$MARIADB_PORT -uadmin -ppassword -e "DROP DATABASE IF EXISTS benchbase; CREATE DATABASE benchbase"
java -jar benchbase.jar -b ${{matrix.benchmark}} -c config/mariadb/sample_${{matrix.benchmark}}_config.xml --create=true --load=true --execute=true
## ----------------------------------------------------------------------------------
## MYSQL
## ----------------------------------------------------------------------------------
mysql:
needs: package-and-upload
runs-on: ubuntu-latest
Expand Down Expand Up @@ -159,7 +200,9 @@ jobs:
mysql -h127.0.0.1 -P$MYSQL_PORT -uadmin -ppassword -e "DROP DATABASE IF EXISTS benchbase; CREATE DATABASE benchbase"
java -jar benchbase.jar -b ${{matrix.benchmark}} -c config/mysql/sample_${{matrix.benchmark}}_config.xml --create=true --load=true --execute=true
## ----------------------------------------------------------------------------------
## POSTGRESQL
## ----------------------------------------------------------------------------------
postgresql:
needs: package-and-upload
runs-on: ubuntu-latest
Expand Down Expand Up @@ -206,6 +249,9 @@ jobs:
PGPASSWORD=password createdb -h localhost -U admin benchbase
java -jar benchbase.jar -b ${{matrix.benchmark}} -c config/postgres/sample_${{matrix.benchmark}}_config.xml --create=true --load=true --execute=true
## ----------------------------------------------------------------------------------
## COCKROACHDB
## ----------------------------------------------------------------------------------
cockroachdb:
needs: package-and-upload
runs-on: ubuntu-latest
Expand Down Expand Up @@ -244,6 +290,9 @@ jobs:
run: |
java -jar benchbase.jar -b ${{matrix.benchmark}} -c config/cockroachdb/sample_${{matrix.benchmark}}_config.xml --create=true --load=true --execute=true
## ----------------------------------------------------------------------------------
## MSSQL
## ----------------------------------------------------------------------------------
sqlserver:
needs: package-and-upload
runs-on: ubuntu-latest
Expand Down Expand Up @@ -306,3 +355,4 @@ jobs:
# Note: user/pass should match those used in sample configs.
run: |
java -jar benchbase.jar -b ${{matrix.benchmark}} -c config/sqlserver/sample_${{matrix.benchmark}}_config.xml --create=true --load=true --execute=true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ buildNumber.properties
*.iws
*.iml
*.ipr
java_*.hprof*

### NetBeans ###
/nbproject/private/
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ benchmark, leveraging all the system features (logging, controlled speed, contro
## Usage Guide

### How to Build
Run the following command to build the distribution for a given database specified as the profile name (`-P`). The following profiles are currently supported: `postgres`, `mysql`, `mariadb`, `cockroachdb`, `phoenix` and `spanner`.
Run the following command to build the distribution for a given database specified as the profile name (`-P`). The following profiles are currently supported: `postgres`, `mysql`, `mariadb`, `sqlite`, `cockroachdb`, `phoenix`, and `spanner`.

```bash
./mvnw clean package -P <profile name>
Expand Down Expand Up @@ -237,5 +237,5 @@ The BibTeX is provided below for convenience.
year = {2013},
pages = {277--288},
url = {http://www.vldb.org/pvldb/vol7/p277-difallah.pdf},
}
```
}
```
57 changes: 57 additions & 0 deletions config/sqlite/sample_auctionmark_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0"?>
<parameters>

<!-- Connection details -->
<type>SQLITE</type>
<driver>org.sqlite.JDBC</driver>
<url>jdbc:sqlite:auctionmark.db</url>
<isolation>TRANSACTION_SERIALIZABLE</isolation>
<batchsize>128</batchsize>

<!-- Scalefactor in AuctionMark scales by *1000 the number of customers-->
<scalefactor>0.1</scalefactor>

<!-- SQLITE only supports one writer thread -->
<loaderThreads>1</loaderThreads>

<!-- The workload -->
<terminals>1</terminals>
<works>
<work>
<time>60</time>
<rate>10000</rate>
<weights>45, 10, 20, 2, 1, 4, 10, 5, 3</weights>
</work>
</works>

<!-- AuctionMark Procedures declaration -->
<transactiontypes>
<transactiontype>
<name>GetItem</name>
</transactiontype>
<transactiontype>
<name>GetUserInfo</name>
</transactiontype>
<transactiontype>
<name>NewBid</name>
</transactiontype>
<transactiontype>
<name>NewComment</name>
</transactiontype>
<transactiontype>
<name>NewCommentResponse</name>
</transactiontype>
<transactiontype>
<name>NewFeedback</name>
</transactiontype>
<transactiontype>
<name>NewItem</name>
</transactiontype>
<transactiontype>
<name>NewPurchase</name>
</transactiontype>
<transactiontype>
<name>UpdateItem</name>
</transactiontype>
</transactiontypes>
</parameters>
57 changes: 57 additions & 0 deletions config/sqlite/sample_epinions_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0"?>
<parameters>

<!-- Connection details -->
<type>SQLITE</type>
<driver>org.sqlite.JDBC</driver>
<url>jdbc:sqlite:resourcestresser.db</url>
<isolation>TRANSACTION_SERIALIZABLE</isolation>
<batchsize>128</batchsize>

<!-- Scalefactor in Epinions scales by *2000 the number of users-->
<scalefactor>0.1</scalefactor>

<!-- SQLITE only supports one writer thread -->
<loaderThreads>1</loaderThreads>

<!-- The workload -->
<terminals>1</terminals>
<works>
<work>
<time>60</time>
<rate>10000</rate>
<weights>10,10,10,10,10,10,10,10,20</weights>
</work>
</works>

<!-- Epinions Procedures Declaration -->
<transactiontypes>
<transactiontype>
<name>GetReviewItemById</name>
</transactiontype>
<transactiontype>
<name>GetReviewsByUser</name>
</transactiontype>
<transactiontype>
<name>GetAverageRatingByTrustedUser</name>
</transactiontype>
<transactiontype>
<name>GetItemAverageRating</name>
</transactiontype>
<transactiontype>
<name>GetItemReviewsByTrustedUser</name>
</transactiontype>
<transactiontype>
<name>UpdateUserName</name>
</transactiontype>
<transactiontype>
<name>UpdateItemTitle</name>
</transactiontype>
<transactiontype>
<name>UpdateReviewRating</name>
</transactiontype>
<transactiontype>
<name>UpdateTrustRating</name>
</transactiontype>
</transactiontypes>
</parameters>
121 changes: 121 additions & 0 deletions config/sqlite/sample_hyadapt_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<?xml version="1.0"?>
<parameters>

<!-- Connection details -->
<type>SQLITE</type>
<driver>org.sqlite.JDBC</driver>
<url>jdbc:sqlite:hyadapt.db</url>
<isolation>TRANSACTION_SERIALIZABLE</isolation>
<batchsize>128</batchsize>

<scalefactor>0.1</scalefactor>

<!-- SQLITE only supports one writer thread -->
<loaderThreads>1</loaderThreads>

<terminals>1</terminals>
<works>
<work>
<time>60</time>
<rate>10000</rate>
<weights>1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</weights>
</work>
</works>

<transactiontypes>
<transactiontype>
<name>MaxRecord1</name>
</transactiontype>
<transactiontype>
<name>MaxRecord2</name>
</transactiontype>
<transactiontype>
<name>MaxRecord3</name>
</transactiontype>
<transactiontype>
<name>MaxRecord4</name>
</transactiontype>
<transactiontype>
<name>MaxRecord5</name>
</transactiontype>
<transactiontype>
<name>MaxRecord6</name>
</transactiontype>
<transactiontype>
<name>MaxRecord7</name>
</transactiontype>
<transactiontype>
<name>MaxRecord8</name>
</transactiontype>
<transactiontype>
<name>MaxRecord9</name>
</transactiontype>
<transactiontype>
<name>MaxRecord10</name>
</transactiontype>

<transactiontype>
<name>ReadRecord1</name>
</transactiontype>
<transactiontype>
<name>ReadRecord2</name>
</transactiontype>
<transactiontype>
<name>ReadRecord3</name>
</transactiontype>
<transactiontype>
<name>ReadRecord4</name>
</transactiontype>
<transactiontype>
<name>ReadRecord5</name>
</transactiontype>
<transactiontype>
<name>ReadRecord6</name>
</transactiontype>
<transactiontype>
<name>ReadRecord7</name>
</transactiontype>
<transactiontype>
<name>ReadRecord8</name>
</transactiontype>
<transactiontype>
<name>ReadRecord9</name>
</transactiontype>
<transactiontype>
<name>ReadRecord10</name>
</transactiontype>


<transactiontype>
<name>SumRecord1</name>
</transactiontype>
<transactiontype>
<name>SumRecord2</name>
</transactiontype>
<transactiontype>
<name>SumRecord3</name>
</transactiontype>
<transactiontype>
<name>SumRecord4</name>
</transactiontype>
<transactiontype>
<name>SumRecord5</name>
</transactiontype>
<transactiontype>
<name>SumRecord6</name>
</transactiontype>
<transactiontype>
<name>SumRecord7</name>
</transactiontype>
<transactiontype>
<name>SumRecord8</name>
</transactiontype>
<transactiontype>
<name>SumRecord9</name>
</transactiontype>
<transactiontype>
<name>SumRecord10</name>
</transactiontype>

</transactiontypes>
</parameters>
31 changes: 31 additions & 0 deletions config/sqlite/sample_noop_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0"?>
<parameters>

<!-- Connection details -->
<type>SQLITE</type>
<driver>org.sqlite.JDBC</driver>
<url>jdbc:sqlite:noop.db</url>
<isolation>TRANSACTION_SERIALIZABLE</isolation>
<batchsize>128</batchsize>

<!-- This parameter has no affect on this benchmark-->
<!-- There is no data to load -->
<scalefactor>1</scalefactor>

<!-- The workload -->
<terminals>1</terminals>
<works>
<work>
<time>60</time>
<rate>1000</rate>
<weights>100</weights>
</work>
</works>

<!-- NoOp Procedures declaration -->
<transactiontypes>
<transactiontype>
<name>NoOp</name>
</transactiontype>
</transactiontypes>
</parameters>
Loading

0 comments on commit 01a37b9

Please sign in to comment.