├── .gitignore ├── CMakeLists.txt ├── README.md ├── analysis ├── blob.py ├── data │ ├── blob │ │ ├── c220g5.csv │ │ └── rpi.csv │ ├── footprints.txt │ ├── ssb │ │ ├── c220g5.csv │ │ ├── profiles │ │ │ ├── bloom │ │ │ │ ├── Q1.1.txt │ │ │ │ ├── Q1.2.txt │ │ │ │ ├── Q1.3.txt │ │ │ │ ├── Q2.1.txt │ │ │ │ ├── Q2.2.txt │ │ │ │ ├── Q2.3.txt │ │ │ │ ├── Q3.1.txt │ │ │ │ ├── Q3.2.txt │ │ │ │ ├── Q3.3.txt │ │ │ │ ├── Q3.4.txt │ │ │ │ ├── Q4.1.txt │ │ │ │ ├── Q4.2.txt │ │ │ │ └── Q4.3.txt │ │ │ └── vanilla │ │ │ │ ├── Q1.1.txt │ │ │ │ ├── Q1.2.txt │ │ │ │ ├── Q1.3.txt │ │ │ │ ├── Q2.1.txt │ │ │ │ ├── Q2.2.txt │ │ │ │ ├── Q2.3.txt │ │ │ │ ├── Q3.1.txt │ │ │ │ ├── Q3.2.txt │ │ │ │ ├── Q3.3.txt │ │ │ │ ├── Q3.4.txt │ │ │ │ ├── Q4.1.txt │ │ │ │ ├── Q4.2.txt │ │ │ │ └── Q4.3.txt │ │ └── rpi.csv │ └── tatp │ │ ├── c220g5.csv │ │ └── rpi.csv ├── logs │ ├── c220g5 │ │ ├── out.txt │ │ └── ssb_out.txt │ └── rpi │ │ ├── sqlite-performance_blob_log.txt │ │ ├── sqlite-performance_ssb-partial_log.txt │ │ ├── sqlite-performance_ssb-rerun_log.txt │ │ └── sqlite-performance_tatp_log.txt ├── plots │ ├── blob_100_KB_c220g5.pdf │ ├── blob_100_KB_rpi.pdf │ ├── blob_10_MB_c220g5.pdf │ ├── blob_10_MB_rpi.pdf │ ├── profile_bloom.pdf │ ├── profile_vanilla.pdf │ ├── ssb_bloom_c220g5.pdf │ ├── ssb_bloom_rpi.pdf │ ├── ssb_c220g5.pdf │ ├── ssb_rpi.pdf │ ├── tatp_c220g5.pdf │ └── tatp_rpi.pdf ├── profile.py ├── ssb.py ├── tatp.py └── util.py ├── scripts ├── all.sh └── benchmarks │ ├── blob.sh │ ├── ssb.sh │ └── tatp.sh └── src ├── benchmarks ├── blob │ ├── blob_duckdb.cpp │ ├── blob_sqlite3.cpp │ └── helpers.hpp ├── ssb │ ├── dbgen │ │ ├── .gitignore │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── bcd2.c │ │ ├── bcd2.h │ │ ├── bm_utils.c │ │ ├── build.c │ │ ├── config.h.in │ │ ├── dists.dss │ │ ├── driver.c │ │ ├── dss.h │ │ ├── dsstypes.h │ │ ├── life_noise.h │ │ ├── load_stub.c │ │ ├── permute.c │ │ ├── permute.h │ │ ├── print.c │ │ ├── rnd.c │ │ ├── rnd.h │ │ ├── shared.h │ │ ├── speed_seed.c │ │ └── text.c │ ├── helpers.hpp │ ├── sql │ │ ├── init │ │ │ ├── duckdb.sql │ │ │ └── sqlite3.sql │ │ ├── q1.1.sql │ │ ├── q1.2.sql │ │ ├── q1.3.sql │ │ ├── q2.1.sql │ │ ├── q2.2.sql │ │ ├── q2.3.sql │ │ ├── q3.1.sql │ │ ├── q3.2.sql │ │ ├── q3.3.sql │ │ ├── q3.4.sql │ │ ├── q4.1.sql │ │ ├── q4.2.sql │ │ └── q4.3.sql │ ├── ssb_duckdb.cpp │ └── ssb_sqlite3.cpp └── tatp │ ├── helpers.hpp │ ├── sql │ ├── init │ │ ├── duckdb.sql │ │ └── sqlite3.sql │ ├── stmt_0.sql │ ├── stmt_1.sql │ ├── stmt_2.sql │ ├── stmt_3.sql │ ├── stmt_4.sql │ ├── stmt_5.sql │ ├── stmt_6.sql │ ├── stmt_7.sql │ ├── stmt_8.sql │ └── stmt_9.sql │ ├── tatp_duckdb.cpp │ └── tatp_sqlite3.cpp ├── readfile.hpp └── systems ├── duckdb ├── duckdb.cpp ├── duckdb.h └── duckdb.hpp └── sqlite ├── shell.c ├── sqlite3.c └── sqlite3.h /.gitignore: -------------------------------------------------------------------------------- 1 | /cmake-build-debug 2 | /cmake-build-release 3 | /.idea 4 | /analysis/.idea 5 | /analysis/venv 6 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) 2 | project(sqlite_performance) 3 | 4 | set(CMAKE_CXX_STANDARD 17) 5 | set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) 6 | 7 | include(FetchContent) 8 | 9 | find_package(Threads REQUIRED) 10 | 11 | FetchContent_Declare( 12 | cxxopts 13 | GIT_REPOSITORY https://github.com/jarro2783/cxxopts.git 14 | GIT_TAG v2.2.1 15 | ) 16 | set(CXXOPTS_BUILD_EXAMPLES OFF) 17 | set(CXXOPTS_BUILD_TESTS OFF) 18 | set(CXXOPTS_ENABLE_INSTALL OFF) 19 | set(CXXOPTS_ENABLE_WARNINGS OFF) 20 | FetchContent_MakeAvailable(cxxopts) 21 | 22 | FetchContent_Declare( 23 | dbbench 24 | GIT_REPOSITORY https://github.com/kpgaffney/dbbench.git 25 | GIT_TAG main 26 | ) 27 | set(DBBENCH_BUILD_EXAMPLES OFF) 28 | FetchContent_MakeAvailable(dbbench) 29 | 30 | FetchContent_Declare( 31 | sqlite3cpp 32 | GIT_REPOSITORY https://github.com/kpgaffney/sqlite3cpp.git 33 | GIT_TAG main 34 | ) 35 | set(SQLITE3CPP_BUILD_TESTS OFF) 36 | FetchContent_MakeAvailable(sqlite3cpp) 37 | 38 | add_library( 39 | sqlite3 40 | src/systems/sqlite/sqlite3.c 41 | src/systems/sqlite/sqlite3.h 42 | ) 43 | target_compile_options( 44 | sqlite3 45 | PRIVATE 46 | -DSQLITE_DQS=0 47 | -DSQLITE_THREADSAFE=0 48 | -DSQLITE_OMIT_LOAD_EXTENSION 49 | -DSQLITE_DEFAULT_MEMSTATUS=0 50 | -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 51 | -DSQLITE_LIKE_DOESNT_MATCH_BLOBS 52 | -DSQLITE_MAX_EXPR_DEPTH=0 53 | -DSQLITE_OMIT_DECLTYPE 54 | -DSQLITE_OMIT_DEPRECATED 55 | -DSQLITE_OMIT_PROGRESS_CALLBACK 56 | -DSQLITE_OMIT_SHARED_CACHE 57 | -DSQLITE_USE_ALLOCA 58 | -DSQLITE_OMIT_AUTOINIT 59 | ) 60 | 61 | add_library( 62 | sqlite3_vdbe_profile 63 | src/systems/sqlite/sqlite3.c 64 | src/systems/sqlite/sqlite3.h 65 | ) 66 | target_compile_options( 67 | sqlite3_vdbe_profile 68 | PRIVATE 69 | -DSQLITE_DQS=0 70 | -DSQLITE_THREADSAFE=0 71 | -DSQLITE_OMIT_LOAD_EXTENSION 72 | -DSQLITE_DEFAULT_MEMSTATUS=0 73 | -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 74 | -DSQLITE_LIKE_DOESNT_MATCH_BLOBS 75 | -DSQLITE_MAX_EXPR_DEPTH=0 76 | -DSQLITE_OMIT_DECLTYPE 77 | -DSQLITE_OMIT_DEPRECATED 78 | -DSQLITE_OMIT_PROGRESS_CALLBACK 79 | -DSQLITE_OMIT_SHARED_CACHE 80 | -DSQLITE_USE_ALLOCA 81 | -DSQLITE_OMIT_AUTOINIT 82 | -DSQLITE_PERFORMANCE_TRACE 83 | -DVDBE_PROFILE 84 | -DSQLITE_HWTIME_USE_INTRINSIC 85 | ) 86 | 87 | add_library( 88 | duckdb 89 | src/systems/duckdb/duckdb.cpp 90 | src/systems/duckdb/duckdb.hpp 91 | ) 92 | target_link_libraries(duckdb Threads::Threads ${CMAKE_DL_LIBS}) 93 | 94 | add_executable( 95 | sqlite3_shell 96 | src/systems/sqlite/shell.c 97 | src/systems/sqlite/sqlite3.c 98 | src/systems/sqlite/sqlite3.h 99 | ) 100 | target_compile_options( 101 | sqlite3_shell 102 | PRIVATE 103 | -DSQLITE_THREADSAFE=0 104 | -DSQLITE_OMIT_LOAD_EXTENSION 105 | ) 106 | 107 | # SSB executables. 108 | 109 | add_subdirectory(src/benchmarks/ssb/dbgen) 110 | 111 | add_executable(ssb_sqlite3 src/benchmarks/ssb/ssb_sqlite3.cpp) 112 | target_include_directories(ssb_sqlite3 PRIVATE src src/systems/sqlite) 113 | target_link_libraries(ssb_sqlite3 cxxopts sqlite3 sqlite3cpp) 114 | set_target_properties( 115 | ssb_sqlite3 116 | PROPERTIES 117 | RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ssb 118 | ) 119 | 120 | add_executable(ssb_sqlite3_vdbe_profile src/benchmarks/ssb/ssb_sqlite3.cpp) 121 | target_include_directories(ssb_sqlite3_vdbe_profile PRIVATE src src/systems/sqlite) 122 | target_link_libraries(ssb_sqlite3_vdbe_profile cxxopts sqlite3_vdbe_profile sqlite3cpp) 123 | set_target_properties( 124 | ssb_sqlite3_vdbe_profile 125 | PROPERTIES 126 | RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ssb 127 | ) 128 | 129 | add_executable(ssb_duckdb src/benchmarks/ssb/ssb_duckdb.cpp) 130 | target_include_directories(ssb_duckdb PRIVATE src) 131 | target_link_libraries(ssb_duckdb cxxopts ${CMAKE_DL_LIBS} duckdb) 132 | set_target_properties( 133 | ssb_duckdb 134 | PROPERTIES 135 | RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ssb 136 | ) 137 | 138 | file(COPY src/benchmarks/ssb/sql DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ssb) 139 | 140 | # TATP executables. 141 | 142 | add_executable(tatp_sqlite3 src/benchmarks/tatp/tatp_sqlite3.cpp) 143 | target_include_directories(tatp_sqlite3 PRIVATE src src/systems/sqlite) 144 | target_link_libraries(tatp_sqlite3 cxxopts dbbench_tatp sqlite3 sqlite3cpp) 145 | set_target_properties( 146 | tatp_sqlite3 147 | PROPERTIES 148 | RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tatp 149 | ) 150 | 151 | add_executable(tatp_duckdb src/benchmarks/tatp/tatp_duckdb.cpp) 152 | target_include_directories(tatp_duckdb PRIVATE src) 153 | target_link_libraries(tatp_duckdb cxxopts dbbench_tatp duckdb) 154 | set_target_properties( 155 | tatp_duckdb 156 | PROPERTIES 157 | RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tatp 158 | ) 159 | 160 | # Blob executables. 161 | 162 | add_executable(blob_sqlite3 src/benchmarks/blob/blob_sqlite3.cpp) 163 | target_include_directories(blob_sqlite3 PRIVATE src src/systems/sqlite) 164 | target_link_libraries(blob_sqlite3 cxxopts dbbench_core sqlite3 sqlite3cpp) 165 | set_target_properties( 166 | blob_sqlite3 167 | PROPERTIES 168 | RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/blob 169 | ) 170 | 171 | add_executable(blob_duckdb src/benchmarks/blob/blob_duckdb.cpp) 172 | target_include_directories(blob_duckdb PRIVATE src) 173 | target_link_libraries(blob_duckdb cxxopts dbbench_core duckdb) 174 | set_target_properties( 175 | blob_duckdb 176 | PROPERTIES 177 | RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/blob 178 | ) 179 | 180 | # Scripts. 181 | configure_file(scripts/benchmarks/ssb.sh ${CMAKE_CURRENT_BINARY_DIR}/ssb/ssb.sh COPYONLY) 182 | configure_file(scripts/benchmarks/tatp.sh ${CMAKE_CURRENT_BINARY_DIR}/tatp/tatp.sh COPYONLY) 183 | configure_file(scripts/benchmarks/blob.sh ${CMAKE_CURRENT_BINARY_DIR}/blob/blob.sh COPYONLY) 184 | configure_file(scripts/all.sh ${CMAKE_CURRENT_BINARY_DIR}/all.sh COPYONLY) 185 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SQLite: Past, Present, and Future 2 | 3 | Performance evaluation and optimization of SQLite. Accompanying source code for the VLDB 2022 paper. 4 | 5 | ## Requirements 6 | 7 | * CMake >= 3.16 8 | 9 | ## How to run the benchmarks 10 | 11 | First, ensure you have CMake >= 3.16 installed. 12 | 13 | Then, run CMake to configure the project: 14 | ``` 15 | mkdir build 16 | cd build 17 | cmake .. -DCMAKE_BUILD_TYPE=Release 18 | ``` 19 | 20 | Build the executables: 21 | ``` 22 | cmake --build . 23 | ``` 24 | Executables for *SSB*, *TATP*, and *Blob* will be placed in their respective directories. 25 | 26 | Modify the permissions of the scripts: 27 | ``` 28 | chmod u+x ssb/ssb.sh 29 | chmod u+x tatp/tatp.sh 30 | chmod u+x blob/blob.sh 31 | chmod u+x all.sh 32 | ``` 33 | 34 | Run a specific benchmark by moving to its directory and then executing the script. For example: 35 | ``` 36 | cd ssb 37 | ./ssb.sh 38 | ``` 39 | 40 | Run all benchmarks by executing the *all* script: 41 | ``` 42 | ./all.sh 43 | ``` 44 | -------------------------------------------------------------------------------- /analysis/blob.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | import matplotlib as mpl 3 | import matplotlib.pyplot as plt 4 | import seaborn as sns 5 | 6 | from util import hardware 7 | 8 | mpl.rc('pdf', fonttype=42) 9 | pd.set_option('display.max_columns', None) 10 | 11 | sns.set() 12 | 13 | palette = sns.color_palette('colorblind') 14 | palette[1], palette[2] = palette[2], palette[1] 15 | sns.set_palette(palette) 16 | 17 | for hw in hardware: 18 | for size in ['100 KB', '10 MB']: 19 | df = pd.read_csv(f'data/blob/{hw}.csv') 20 | df = (df[df['size'] == size] 21 | .groupby(['mix', 'system'], sort=False)[['throughput']] 22 | .agg(['mean', 'min', 'max']) 23 | .unstack() 24 | .droplevel(0, axis=1) 25 | .reset_index()) 26 | 27 | err_lo = df['mean'] - df['min'] 28 | err_hi = df['max'] - df['mean'] 29 | 30 | if size == '100 KB' and hw == 'c220g5': 31 | ylim = (0, 11000) 32 | h = 920 33 | elif size == '100 KB' and hw == 'rpi': 34 | ylim = (0, 1700) 35 | h = 140 36 | elif size == '10 MB' and hw == 'c220g5': 37 | ylim = (0, 210) 38 | h = 17 39 | else: 40 | ylim = (0, 35) 41 | h = 3 42 | 43 | ax = df.plot( 44 | kind='bar', 45 | x='mix', 46 | y='mean', 47 | # yerr=[[err_lo[s], err_hi[s]] for s in ['sqlite-WAL', 'sqlite-DELETE', 'duckdb', 'filesystem']], 48 | ylim=ylim, 49 | rot=0, 50 | width=0.85, 51 | figsize=(5.8, 2.5) 52 | ) 53 | 54 | for i, patch in enumerate(ax.patches): 55 | height = patch.get_height() 56 | # label = str(round(height)) if height < 1000 else '{:.0e}'.format(height).replace('+0', '') 57 | 58 | if height > 0: 59 | label = '{:.0e}'.format(height).replace('+0', '') 60 | else: 61 | label = '' 62 | 63 | # if height > 0: 64 | # label = str(int(round(height, -int(math.floor(math.log10(height))) + 1))) 65 | # else: 66 | # label = '' 67 | 68 | if size == '100 KB' and hw == 'rpi' and i == 6: 69 | d = 60 70 | elif size == '10 MB' and hw == 'rpi' and i == 6: 71 | d = 1.5 72 | else: 73 | d = 0 74 | 75 | ax.annotate( 76 | label, 77 | # (patch.get_x() + 0.5 * patch.get_width(), patch.get_height() + h + d), 78 | (patch.get_x() + 0.5 * patch.get_width(), patch.get_height() + h), 79 | # color='white', 80 | alpha=0.8, 81 | size='small', 82 | ha='center', 83 | va='top' 84 | ) 85 | 86 | plt.grid(False, axis='x') 87 | plt.xticks([0, 1, 2], labels=['90%', '50%', '10%']) 88 | plt.xlabel('Read percentage') 89 | plt.ylabel('Throughput (TPS)') 90 | plt.legend(labels=['SQLite-WAL', 'SQLite-DELETE', 'DuckDB', 'Filesystem']) 91 | plt.subplots_adjust(left=0.14, right=0.99, top=0.98, bottom=0.2) 92 | plt.savefig(f'plots/blob_{size}_{hw}.pdf'.replace(' ', '_')) 93 | -------------------------------------------------------------------------------- /analysis/data/blob/c220g5.csv: -------------------------------------------------------------------------------- 1 | system,size,mix,trial,throughput 2 | sqlite-WAL,100 KB,0.9,1,8972.58 3 | sqlite-WAL,100 KB,0.9,2,9088.43 4 | sqlite-WAL,100 KB,0.9,3,9059.67 5 | sqlite-WAL,100 KB,0.5,1,1946.9 6 | sqlite-WAL,100 KB,0.5,2,1943.8 7 | sqlite-WAL,100 KB,0.5,3,1952 8 | sqlite-WAL,100 KB,0.1,1,1089.05 9 | sqlite-WAL,100 KB,0.1,2,1091.35 10 | sqlite-WAL,100 KB,0.1,3,1091.5 11 | sqlite-WAL,1 MB,0.9,1,1383.35 12 | sqlite-WAL,1 MB,0.9,2,1360.13 13 | sqlite-WAL,1 MB,0.9,3,1348.53 14 | sqlite-WAL,1 MB,0.5,1,294.483 15 | sqlite-WAL,1 MB,0.5,2,287.8 16 | sqlite-WAL,1 MB,0.5,3,314.617 17 | sqlite-WAL,1 MB,0.1,1,175.533 18 | sqlite-WAL,1 MB,0.1,2,164.017 19 | sqlite-WAL,1 MB,0.1,3,177.967 20 | sqlite-WAL,10 MB,0.9,1,83.9833 21 | sqlite-WAL,10 MB,0.9,2,88.6833 22 | sqlite-WAL,10 MB,0.9,3,82.0833 23 | sqlite-WAL,10 MB,0.5,1,19.95 24 | sqlite-WAL,10 MB,0.5,2,17.9 25 | sqlite-WAL,10 MB,0.5,3,15.0833 26 | sqlite-WAL,10 MB,0.1,1,10.7 27 | sqlite-WAL,10 MB,0.1,2,10.8333 28 | sqlite-WAL,10 MB,0.1,3,10.7167 29 | sqlite-DELETE,100 KB,0.9,1,4085.82 30 | sqlite-DELETE,100 KB,0.9,2,4110.52 31 | sqlite-DELETE,100 KB,0.9,3,4088.7 32 | sqlite-DELETE,100 KB,0.5,1,867.567 33 | sqlite-DELETE,100 KB,0.5,2,863.667 34 | sqlite-DELETE,100 KB,0.5,3,861.35 35 | sqlite-DELETE,100 KB,0.1,1,478.017 36 | sqlite-DELETE,100 KB,0.1,2,481.3 37 | sqlite-DELETE,100 KB,0.1,3,484.133 38 | sqlite-DELETE,1 MB,0.9,1,811.767 39 | sqlite-DELETE,1 MB,0.9,2,853.35 40 | sqlite-DELETE,1 MB,0.9,3,837.867 41 | sqlite-DELETE,1 MB,0.5,1,184.9 42 | sqlite-DELETE,1 MB,0.5,2,182.75 43 | sqlite-DELETE,1 MB,0.5,3,169.35 44 | sqlite-DELETE,1 MB,0.1,1,104.817 45 | sqlite-DELETE,1 MB,0.1,2,105.1 46 | sqlite-DELETE,1 MB,0.1,3,103.95 47 | sqlite-DELETE,10 MB,0.9,1,77.5 48 | sqlite-DELETE,10 MB,0.9,2,83.45 49 | sqlite-DELETE,10 MB,0.9,3,81.1333 50 | sqlite-DELETE,10 MB,0.5,1,17.7833 51 | sqlite-DELETE,10 MB,0.5,2,17.7833 52 | sqlite-DELETE,10 MB,0.5,3,17.7667 53 | sqlite-DELETE,10 MB,0.1,1,9.46667 54 | sqlite-DELETE,10 MB,0.1,2,10.2 55 | sqlite-DELETE,10 MB,0.1,3,10.0833 56 | duckdb,100 KB,0.9,1,6358.07 57 | duckdb,100 KB,0.9,2,6250.65 58 | duckdb,100 KB,0.9,3,6328.38 59 | duckdb,100 KB,0.5,1,1274.73 60 | duckdb,100 KB,0.5,2,1279.08 61 | duckdb,100 KB,0.5,3,1280.72 62 | duckdb,100 KB,0.1,1,714.85 63 | duckdb,100 KB,0.1,2,719.067 64 | duckdb,100 KB,0.1,3,719.717 65 | duckdb,1 MB,0.9,1,1148.08 66 | duckdb,1 MB,0.9,2,1171.1 67 | duckdb,1 MB,0.9,3,1161.38 68 | duckdb,1 MB,0.5,1,236.05 69 | duckdb,1 MB,0.5,2,239.117 70 | duckdb,1 MB,0.5,3,233.117 71 | duckdb,1 MB,0.1,1,128.633 72 | duckdb,1 MB,0.1,2,129.183 73 | duckdb,1 MB,0.1,3,128.6 74 | duckdb,10 MB,0.9,1,130.383 75 | duckdb,10 MB,0.9,2,130.883 76 | duckdb,10 MB,0.9,3,124.417 77 | duckdb,10 MB,0.5,1,0 78 | duckdb,10 MB,0.5,2,0 79 | duckdb,10 MB,0.5,3,0 80 | duckdb,10 MB,0.1,1,0 81 | duckdb,10 MB,0.1,2,0 82 | duckdb,10 MB,0.1,3,0 83 | filesystem,100 KB,0.9,1,8349.05 84 | filesystem,100 KB,0.9,2,8177.7 85 | filesystem,100 KB,0.9,3,8199.88 86 | filesystem,100 KB,0.5,1,1703.12 87 | filesystem,100 KB,0.5,2,1690.32 88 | filesystem,100 KB,0.5,3,1686.52 89 | filesystem,100 KB,0.1,1,932.633 90 | filesystem,100 KB,0.1,2,934.9 91 | filesystem,100 KB,0.1,3,930.167 92 | filesystem,1 MB,0.9,1,2312.18 93 | filesystem,1 MB,0.9,2,1929.58 94 | filesystem,1 MB,0.9,3,1973.27 95 | filesystem,1 MB,0.5,1,484.017 96 | filesystem,1 MB,0.5,2,490.783 97 | filesystem,1 MB,0.5,3,501.667 98 | filesystem,1 MB,0.1,1,285.85 99 | filesystem,1 MB,0.1,2,290.85 100 | filesystem,1 MB,0.1,3,295.25 101 | filesystem,10 MB,0.9,1,169.5 102 | filesystem,10 MB,0.9,2,169.117 103 | filesystem,10 MB,0.9,3,172.467 104 | filesystem,10 MB,0.5,1,48.8 105 | filesystem,10 MB,0.5,2,49.15 106 | filesystem,10 MB,0.5,3,51.15 107 | filesystem,10 MB,0.1,1,30.05 108 | filesystem,10 MB,0.1,2,30.1667 109 | filesystem,10 MB,0.1,3,29.9833 110 | -------------------------------------------------------------------------------- /analysis/data/blob/rpi.csv: -------------------------------------------------------------------------------- 1 | system,size,mix,trial,throughput 2 | sqlite-WAL,100 KB,0.9,1,760.017 3 | sqlite-WAL,100 KB,0.9,2,768.9 4 | sqlite-WAL,100 KB,0.9,3,788.483 5 | sqlite-WAL,100 KB,0.5,1,151.9 6 | sqlite-WAL,100 KB,0.5,2,172.033 7 | sqlite-WAL,100 KB,0.5,3,156.733 8 | sqlite-WAL,100 KB,0.1,1,86.7833 9 | sqlite-WAL,100 KB,0.1,2,88.5833 10 | sqlite-WAL,100 KB,0.1,3,84.6833 11 | sqlite-WAL,1 MB,0.9,1,162.75 12 | sqlite-WAL,1 MB,0.9,2,162.25 13 | sqlite-WAL,1 MB,0.9,3,170.967 14 | sqlite-WAL,1 MB,0.5,1,35.6 15 | sqlite-WAL,1 MB,0.5,2,36.0833 16 | sqlite-WAL,1 MB,0.5,3,34.3667 17 | sqlite-WAL,1 MB,0.1,1,18.8333 18 | sqlite-WAL,1 MB,0.1,2,18.0333 19 | sqlite-WAL,1 MB,0.1,3,20.1833 20 | sqlite-WAL,10 MB,0.9,1,12.6167 21 | sqlite-WAL,10 MB,0.9,2,12.05 22 | sqlite-WAL,10 MB,0.9,3,12.3 23 | sqlite-WAL,10 MB,0.5,1,2.65 24 | sqlite-WAL,10 MB,0.5,2,2.71667 25 | sqlite-WAL,10 MB,0.5,3,2.58333 26 | sqlite-WAL,10 MB,0.1,1,1.41667 27 | sqlite-WAL,10 MB,0.1,2,1.56667 28 | sqlite-WAL,10 MB,0.1,3,1.53333 29 | sqlite-DELETE,100 KB,0.9,1,263.15 30 | sqlite-DELETE,100 KB,0.9,2,291.967 31 | sqlite-DELETE,100 KB,0.9,3,299.2 32 | sqlite-DELETE,100 KB,0.5,1,60.8167 33 | sqlite-DELETE,100 KB,0.5,2,61 34 | sqlite-DELETE,100 KB,0.5,3,64.7833 35 | sqlite-DELETE,100 KB,0.1,1,33.6833 36 | sqlite-DELETE,100 KB,0.1,2,35.0667 37 | sqlite-DELETE,100 KB,0.1,3,31.7333 38 | sqlite-DELETE,1 MB,0.9,1,102.033 39 | sqlite-DELETE,1 MB,0.9,2,98.15 40 | sqlite-DELETE,1 MB,0.9,3,103.433 41 | sqlite-DELETE,1 MB,0.5,1,18.1667 42 | sqlite-DELETE,1 MB,0.5,2,18.45 43 | sqlite-DELETE,1 MB,0.5,3,19.1667 44 | sqlite-DELETE,1 MB,0.1,1,10.8 45 | sqlite-DELETE,1 MB,0.1,2,10.2833 46 | sqlite-DELETE,1 MB,0.1,3,10.75 47 | sqlite-DELETE,10 MB,0.9,1,13.0833 48 | sqlite-DELETE,10 MB,0.9,2,12.6667 49 | sqlite-DELETE,10 MB,0.9,3,13.3 50 | sqlite-DELETE,10 MB,0.5,1,2.43333 51 | sqlite-DELETE,10 MB,0.5,2,2.16667 52 | sqlite-DELETE,10 MB,0.5,3,2.4 53 | sqlite-DELETE,10 MB,0.1,1,1.43333 54 | sqlite-DELETE,10 MB,0.1,2,1.45 55 | sqlite-DELETE,10 MB,0.1,3,1.43333 56 | duckdb,100 KB,0.9,1,490.15 57 | duckdb,100 KB,0.9,2,664.75 58 | duckdb,100 KB,0.9,3,583.75 59 | duckdb,100 KB,0.5,1,142.683 60 | duckdb,100 KB,0.5,2,133.117 61 | duckdb,100 KB,0.5,3,132.75 62 | duckdb,100 KB,0.1,1,71.8667 63 | duckdb,100 KB,0.1,2,68.4667 64 | duckdb,100 KB,0.1,3,78.3 65 | duckdb,1 MB,0.9,1,187.583 66 | duckdb,1 MB,0.9,2,172.383 67 | duckdb,1 MB,0.9,3,161.667 68 | duckdb,1 MB,0.5,1,34.7333 69 | duckdb,1 MB,0.5,2,34.8 70 | duckdb,1 MB,0.5,3,30.7333 71 | duckdb,1 MB,0.1,1,19.2167 72 | duckdb,1 MB,0.1,2,19.0667 73 | duckdb,1 MB,0.1,3,20.3833 74 | duckdb,10 MB,0.9,1,21.4 75 | duckdb,10 MB,0.9,2,24.4167 76 | duckdb,10 MB,0.9,3,21.4333 77 | duckdb,10 MB,0.5,1,4.45 78 | duckdb,10 MB,0.5,2,4.4 79 | duckdb,10 MB,0.5,3,4.68333 80 | duckdb,10 MB,0.1,1,2.53333 81 | duckdb,10 MB,0.1,2,2.56667 82 | duckdb,10 MB,0.1,3,2.51667 83 | filesystem,100 KB,0.9,1,1409.95 84 | filesystem,100 KB,0.9,2,1469.8 85 | filesystem,100 KB,0.9,3,1462.13 86 | filesystem,100 KB,0.5,1,296.15 87 | filesystem,100 KB,0.5,2,300.4 88 | filesystem,100 KB,0.5,3,304.367 89 | filesystem,100 KB,0.1,1,165.25 90 | filesystem,100 KB,0.1,2,176.233 91 | filesystem,100 KB,0.1,3,171.267 92 | filesystem,1 MB,0.9,1,223.933 93 | filesystem,1 MB,0.9,2,247.333 94 | filesystem,1 MB,0.9,3,248.867 95 | filesystem,1 MB,0.5,1,57.15 96 | filesystem,1 MB,0.5,2,54.55 97 | filesystem,1 MB,0.5,3,56.3833 98 | filesystem,1 MB,0.1,1,31.1 99 | filesystem,1 MB,0.1,2,32.2667 100 | filesystem,1 MB,0.1,3,31.1667 101 | filesystem,10 MB,0.9,1,24.8 102 | filesystem,10 MB,0.9,2,23.6333 103 | filesystem,10 MB,0.9,3,24.05 104 | filesystem,10 MB,0.5,1,6.01667 105 | filesystem,10 MB,0.5,2,6.46667 106 | filesystem,10 MB,0.5,3,5.58333 107 | filesystem,10 MB,0.1,1,3.6 108 | filesystem,10 MB,0.1,2,3.6 109 | filesystem,10 MB,0.1,3,3.63333 110 | -------------------------------------------------------------------------------- /analysis/data/footprints.txt: -------------------------------------------------------------------------------- 1 | size of sqlite3.c & sqlite3.h: 9.0 MB 2 | 3 | gcc -c -Os \ 4 | -DSQLITE_DQS=0 \ 5 | -DSQLITE_THREADSAFE=0 \ 6 | -DSQLITE_OMIT_LOAD_EXTENSION \ 7 | -DSQLITE_DEFAULT_MEMSTATUS=0 \ 8 | -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 \ 9 | -DSQLITE_LIKE_DOESNT_MATCH_BLOBS \ 10 | -DSQLITE_MAX_EXPR_DEPTH=0 \ 11 | -DSQLITE_OMIT_DECLTYPE \ 12 | -DSQLITE_OMIT_DEPRECATED \ 13 | -DSQLITE_OMIT_PROGRESS_CALLBACK \ 14 | -DSQLITE_OMIT_SHARED_CACHE \ 15 | -DSQLITE_USE_ALLOCA \ 16 | -DSQLITE_OMIT_AUTOINIT \ 17 | sqlite3.c 18 | time: 15 s 19 | memory: 340 MB 20 | size of libsqlite3.a: 0.9 MB 21 | 22 | gcc -c -O3 \ 23 | -DSQLITE_DQS=0 \ 24 | -DSQLITE_THREADSAFE=0 \ 25 | -DSQLITE_OMIT_LOAD_EXTENSION \ 26 | -DSQLITE_DEFAULT_MEMSTATUS=0 \ 27 | -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 \ 28 | -DSQLITE_LIKE_DOESNT_MATCH_BLOBS \ 29 | -DSQLITE_MAX_EXPR_DEPTH=0 \ 30 | -DSQLITE_OMIT_DECLTYPE \ 31 | -DSQLITE_OMIT_DEPRECATED \ 32 | -DSQLITE_OMIT_PROGRESS_CALLBACK \ 33 | -DSQLITE_OMIT_SHARED_CACHE \ 34 | -DSQLITE_USE_ALLOCA \ 35 | -DSQLITE_OMIT_AUTOINIT \ 36 | sqlite3.c 37 | time: 30 s 38 | memory: 380 MB 39 | size of libsqlite3.a: 1.5 MB 40 | 41 | ssb.sqlite (SF 5) 42 | load time from CSV: 82 s 43 | size: 2.85 GB 44 | 45 | tatp.sqlite (SF 1 M) 46 | size: 520 MB 47 | 48 | blob.sqlite (SF 1 M) 49 | size: 1.85 MB 50 | 51 | size of duckdb.cpp & duckdb.hpp: 10.9 MB 52 | 53 | g++ -c -Os duckdb.cpp 54 | time: 5 m 55 | memory: 7.69 GB 56 | size of libduckdb.a: 32.1 MB 57 | 58 | g++ -c -O3 duckdb.cpp 59 | time: 10 m 60 | memory: 7.60 GB 61 | size of libduckdb.a: 36.8 MB 62 | 63 | ssb.duckdb (SF 5) 64 | load time from CSV: 100 s 65 | size: 1.82 GB 66 | 67 | tatp.duckdb (SF 1 M) 68 | size: 270 MB 69 | 70 | blob.duckdb (SF 1 M) 71 | size: 1.01 MB 72 | -------------------------------------------------------------------------------- /analysis/data/ssb/profiles/bloom/Q1.1.txt: -------------------------------------------------------------------------------- 1 | 1 132 132 0 Init 1 33 0 00 2 | 1 304 304 1 Null 0 1 3 00 3 | 1 358 358 2 OpenRead 0 7 0 12 00 4 | 1 182 182 3 OpenRead 1 6 0 17 00 5 | 1 6622 6622 4 Rewind 0 29 0 00 6 | 29999810 4346944284 144 5 Column 0 11 4 00 7 | 29999810 610579880 20 6 Lt 6 28 4 BINARY-8 54 8 | 27273158 631480374 23 7 Gt 7 28 4 BINARY-8 54 9 | 8181061 172718756 21 8 Column 0 8 4 00 10 | 8181061 231447510 28 9 Ge 8 28 4 BINARY-8 54 11 | 3925700 72310020 18 10 Once 1 19 0 00 12 | 1 92 92 11 Explain 11 0 0 BLOOM FILTER ON date (d_datekey=?) 00 13 | 1 11932 11932 12 Blob 10000 9 0 00 14 | 1 1150 1150 13 Rewind 1 19 0 00 15 | 2557 223104 87 14 Column 1 4 4 00 16 | 2557 47082 18 15 Ne 10 18 4 BINARY-8 54 17 | 365 6972 19 16 Rowid 1 4 0 00 18 | 365 13168 36 17 FilterAdd 9 0 4 1 00 19 | 2557 52702 20 18 Next 1 14 0 00 20 | 3925700 78573878 20 19 Column 0 5 11 00 21 | 3925700 140164762 35 20 Filter 9 28 11 1 00 22 | 3922427 1427618542 363 21 SeekRowid 1 28 11 00 23 | 3922427 251850448 64 22 Column 1 4 4 00 24 | 3922427 108178244 27 23 Ne 10 28 4 BINARY-8 54 25 | 595746 12967228 21 24 Column 0 9 5 00 26 | 595746 18127500 30 25 Column 0 11 12 00 27 | 595746 11024892 18 26 Multiply 12 5 4 00 28 | 595746 15816350 26 27 AggStep1 0 4 1 sum(1) 01 29 | 29999810 615842122 20 28 Next 0 5 0 01 30 | 1 1152 1152 29 AggFinal 1 1 0 sum(1) 00 31 | 1 548 548 30 Copy 1 13 0 00 32 | 0 0 0 31 ResultRow 13 1 0 00 33 | 0 0 0 32 Halt 0 0 0 00 34 | 1 18948 18948 33 Transaction 0 0 6 0 01 35 | 1 58 58 34 Integer 1 6 0 00 36 | 1 20 20 35 Integer 3 7 0 00 37 | 1 18 18 36 Integer 25 8 0 00 38 | 1 18 18 37 Integer 1993 10 0 00 39 | 1 38 38 38 Goto 0 1 0 00 40 | -------------------------------------------------------------------------------- /analysis/data/ssb/profiles/bloom/Q1.2.txt: -------------------------------------------------------------------------------- 1 | 1 220 220 0 Init 1 34 0 00 2 | 1 190 190 1 Null 0 1 3 00 3 | 1 708 708 2 OpenRead 0 7 0 12 00 4 | 1 112 112 3 OpenRead 1 6 0 17 00 5 | 1 4730 4730 4 Rewind 0 30 0 00 6 | 29999810 4315124252 143 5 Column 0 11 4 00 7 | 29999810 786283498 26 6 Lt 6 29 4 BINARY-8 54 8 | 19092097 483515268 25 7 Gt 7 29 4 BINARY-8 54 9 | 8181896 159418532 19 8 Column 0 8 4 00 10 | 8181896 241774814 29 9 Lt 8 29 4 BINARY-8 54 11 | 4091990 105951814 25 10 Gt 9 29 4 BINARY-8 54 12 | 1636207 30160810 18 11 Once 1 20 0 00 13 | 1 34 34 12 Explain 12 0 0 BLOOM FILTER ON date (d_datekey=?) 00 14 | 1 2406 2406 13 Blob 10000 10 0 00 15 | 1 1754 1754 14 Rewind 1 20 0 00 16 | 2557 226288 88 15 Column 1 5 4 00 17 | 2557 50240 19 16 Ne 11 19 4 BINARY-8 54 18 | 31 940 30 17 Rowid 1 4 0 00 19 | 31 1530 49 18 FilterAdd 10 0 4 1 00 20 | 2557 56980 22 19 Next 1 15 0 00 21 | 1636207 30850894 18 20 Column 0 5 12 00 22 | 1636207 65867660 40 21 Filter 10 29 12 1 00 23 | 147852 69283238 468 22 SeekRowid 1 29 12 00 24 | 147852 10320636 69 23 Column 1 5 4 00 25 | 147852 4357426 29 24 Ne 11 29 4 BINARY-8 54 26 | 21202 403890 19 25 Column 0 9 5 00 27 | 21202 401974 18 26 Column 0 11 13 00 28 | 21202 411898 19 27 Multiply 13 5 4 00 29 | 21202 1322284 62 28 AggStep1 0 4 1 sum(1) 01 30 | 29999810 625790196 20 29 Next 0 5 0 01 31 | 1 988 988 30 AggFinal 1 1 0 sum(1) 00 32 | 1 622 622 31 Copy 1 14 0 00 33 | 0 0 0 32 ResultRow 14 1 0 00 34 | 0 0 0 33 Halt 0 0 0 00 35 | 1 26408 26408 34 Transaction 0 0 6 0 01 36 | 1 66 66 35 Integer 4 6 0 00 37 | 1 20 20 36 Integer 6 7 0 00 38 | 1 18 18 37 Integer 26 8 0 00 39 | 1 20 20 38 Integer 35 9 0 00 40 | 1 20 20 39 Integer 199401 11 0 00 41 | 1 82 82 40 Goto 0 1 0 00 42 | -------------------------------------------------------------------------------- /analysis/data/ssb/profiles/bloom/Q1.3.txt: -------------------------------------------------------------------------------- 1 | 1 122 122 0 Init 1 38 0 00 2 | 1 194 194 1 Null 0 1 3 00 3 | 1 556 556 2 OpenRead 0 7 0 12 00 4 | 1 140 140 3 OpenRead 1 6 0 17 00 5 | 1 38690 38690 4 Rewind 0 34 0 00 6 | 29999810 4293346812 143 5 Column 0 11 4 00 7 | 29999810 862592774 28 6 Lt 6 33 4 BINARY-8 54 8 | 16364521 439982712 26 7 Gt 7 33 4 BINARY-8 54 9 | 8182849 158026960 19 8 Column 0 8 4 00 10 | 8182849 202881270 24 9 Lt 8 33 4 BINARY-8 54 11 | 2456807 60179952 24 10 Gt 9 33 4 BINARY-8 54 12 | 819552 15112828 18 11 Once 1 22 0 00 13 | 1 92 92 12 Explain 12 0 0 BLOOM FILTER ON date (d_datekey=?) 00 14 | 1 2500 2500 13 Blob 10000 10 0 00 15 | 1 1388 1388 14 Rewind 1 22 0 00 16 | 2557 304072 118 15 Column 1 11 4 00 17 | 2557 50996 19 16 Ne 11 21 4 BINARY-8 54 18 | 49 1116 22 17 Column 1 4 4 00 19 | 49 1078 22 18 Ne 12 21 4 BINARY-8 54 20 | 7 460 65 19 Rowid 1 4 0 00 21 | 7 610 87 20 FilterAdd 10 0 4 1 00 22 | 2557 55914 21 21 Next 1 15 0 00 23 | 819552 15504514 18 22 Column 0 5 13 00 24 | 819552 30846736 37 23 Filter 10 33 13 1 00 25 | 16635 8213990 493 24 SeekRowid 1 33 13 00 26 | 16635 1539398 92 25 Column 1 11 4 00 27 | 16635 531912 31 26 Ne 11 33 4 BINARY-8 54 28 | 16635 754496 45 27 Column 1 4 4 00 29 | 16635 465250 27 28 Ne 12 33 4 BINARY-8 54 30 | 2374 48154 20 29 Column 0 9 5 00 31 | 2374 44050 18 30 Column 0 11 14 00 32 | 2374 65352 27 31 Multiply 14 5 4 00 33 | 2374 328932 138 32 AggStep1 0 4 1 sum(1) 01 34 | 29999810 621459810 20 33 Next 0 5 0 01 35 | 1 1232 1232 34 AggFinal 1 1 0 sum(1) 00 36 | 1 606 606 35 Copy 1 15 0 00 37 | 0 0 0 36 ResultRow 15 1 0 00 38 | 0 0 0 37 Halt 0 0 0 00 39 | 1 27696 27696 38 Transaction 0 0 6 0 01 40 | 1 44 44 39 Integer 5 6 0 00 41 | 1 18 18 40 Integer 7 7 0 00 42 | 1 16 16 41 Integer 36 8 0 00 43 | 1 18 18 42 Integer 40 9 0 00 44 | 1 18 18 43 Integer 6 11 0 00 45 | 1 16 16 44 Integer 1994 12 0 00 46 | 1 70 70 45 Goto 0 1 0 00 47 | -------------------------------------------------------------------------------- /analysis/data/ssb/profiles/bloom/Q2.1.txt: -------------------------------------------------------------------------------- 1 | 1 242 242 0 Init 1 79 0 00 2 | 1 98 98 1 Noop 4 6 0 00 3 | 1 1746 1746 2 SorterOpen 5 3 0 k(2,B,B) 00 4 | 1 60 60 3 Integer 0 6 0 00 5 | 1 264 264 4 Null 0 9 10 00 6 | 1 60 60 5 Gosub 8 75 0 00 7 | 1 1004 1004 6 OpenRead 0 7 0 13 00 8 | 1 286 286 7 OpenRead 3 4 0 7 00 9 | 1 260 260 8 OpenRead 1 6 0 5 00 10 | 1 746 746 9 OpenRead 2 3 0 9 00 11 | 1 4128 4128 10 Rewind 0 47 0 00 12 | 29999810 557357716 18 11 Once 1 28 0 00 13 | 1 28 28 12 Explain 12 0 0 BLOOM FILTER ON supplier (s_suppkey=?) 00 14 | 1 14102 14102 13 Blob 10000 13 0 00 15 | 1 2284 2284 14 Rewind 3 20 0 00 16 | 10000 1578588 157 15 Column 3 5 14 00 17 | 10000 504198 50 16 Ne 15 19 14 BINARY-8 52 18 | 2036 39580 19 17 Rowid 3 14 0 00 19 | 2036 75830 37 18 FilterAdd 13 0 14 1 00 20 | 10000 220250 22 19 Next 3 15 0 00 21 | 1 32 32 20 Explain 20 0 0 BLOOM FILTER ON part (p_partkey=?) 00 22 | 1 770216 770216 21 Blob 589824 16 0 00 23 | 1 3488 3488 22 Rewind 2 28 0 00 24 | 600000 81772156 136 23 Column 2 3 14 00 25 | 600000 22654112 37 24 Ne 17 27 14 BINARY-8 52 26 | 24274 446714 18 25 Rowid 2 14 0 00 27 | 24274 849170 34 26 FilterAdd 16 0 14 1 00 28 | 600000 12680342 21 27 Next 2 23 0 00 29 | 29999810 3649989118 121 28 Column 0 4 18 00 30 | 29999810 1306221296 43 29 Filter 13 46 18 1 00 31 | 6110928 149101500 24 30 Column 0 3 14 00 32 | 6110928 237014816 38 31 Filter 16 46 14 1 00 33 | 254870 194167914 761 32 SeekRowid 3 46 18 00 34 | 254870 21746928 85 33 Column 3 5 19 00 35 | 254870 10149938 39 34 Ne 15 46 19 BINARY-8 52 36 | 254870 13471734 52 35 Column 0 5 20 00 37 | 254870 147760282 579 36 SeekRowid 1 46 20 00 38 | 254870 6322788 24 37 Column 0 3 21 00 39 | 254870 471633154 1850 38 SeekRowid 2 46 21 00 40 | 254870 21244998 83 39 Column 2 3 19 00 41 | 254870 9702974 38 40 Ne 17 46 19 BINARY-8 52 42 | 248554 18437538 74 41 Column 1 4 22 00 43 | 248554 9064878 36 42 Column 2 4 23 00 44 | 248554 12187010 49 43 Column 0 12 24 00 45 | 248554 15803776 63 44 MakeRecord 22 3 19 00 46 | 248554 29479190 118 45 SorterInsert 5 19 0 00 47 | 29999810 640146404 21 46 Next 0 11 0 01 48 | 1 1360 1360 47 OpenPseudo 6 19 3 00 49 | 1 322947034 322947034 48 SorterSort 5 78 0 00 50 | 248554 4625164 18 49 SorterData 5 19 6 00 51 | 248554 8999870 36 50 Column 6 0 11 00 52 | 248554 9702220 39 51 Column 6 1 12 00 53 | 248554 10983916 44 52 Compare 9 11 2 k(2,B,B) 00 54 | 248554 4569018 18 53 Jump 54 58 54 00 55 | 280 9352 33 54 Move 11 9 2 00 56 | 280 5546 19 55 Gosub 7 69 0 00 57 | 280 5174 18 56 IfPos 6 78 0 00 58 | 280 5176 18 57 Gosub 8 75 0 00 59 | 248554 8417194 33 58 Column 6 2 25 00 60 | 248554 5335290 21 59 AggStep1 0 25 1 sum(1) 01 61 | 248554 4630358 18 60 If 5 63 0 00 62 | 280 5330 19 61 Column 6 0 2 00 63 | 280 6782 24 62 Column 6 1 3 00 64 | 248554 4571636 18 63 Integer 1 5 0 00 65 | 248554 4644028 18 64 SorterNext 5 49 0 00 66 | 1 34 34 65 Gosub 7 69 0 00 67 | 1 32 32 66 Goto 0 78 0 00 68 | 0 0 0 67 Integer 1 6 0 00 69 | 0 0 0 68 Return 7 0 0 00 70 | 281 5832 20 69 IfPos 5 71 0 00 71 | 1 242 242 70 Return 7 0 0 00 72 | 280 14000 50 71 AggFinal 1 1 0 sum(1) 00 73 | 280 24098 86 72 Copy 1 26 2 00 74 | 0 0 0 73 ResultRow 26 3 0 00 75 | 280 6720 24 74 Return 7 0 0 00 76 | 281 13160 46 75 Null 0 1 4 00 77 | 281 5554 19 76 Integer 0 5 0 00 78 | 281 5322 18 77 Return 8 0 0 00 79 | 0 0 0 78 Halt 0 0 0 00 80 | 1 31392 31392 79 Transaction 0 0 6 0 01 81 | 1 224 224 80 String 7 15 0 AMERICA 00 82 | 1 46 46 81 String 7 17 0 MFGR#12 00 83 | 1 78 78 82 Goto 0 1 0 00 84 | -------------------------------------------------------------------------------- /analysis/data/ssb/profiles/bloom/Q2.2.txt: -------------------------------------------------------------------------------- 1 | 1 192 192 0 Init 1 81 0 00 2 | 1 236 236 1 Noop 4 6 0 00 3 | 1 1608 1608 2 SorterOpen 5 3 0 k(2,B,B) 00 4 | 1 64 64 3 Integer 0 6 0 00 5 | 1 120 120 4 Null 0 9 10 00 6 | 1 50 50 5 Gosub 8 77 0 00 7 | 1 860 860 6 OpenRead 0 7 0 13 00 8 | 1 216 216 7 OpenRead 3 4 0 7 00 9 | 1 84 84 8 OpenRead 1 6 0 5 00 10 | 1 188 188 9 OpenRead 2 3 0 9 00 11 | 1 5254 5254 10 Rewind 0 49 0 00 12 | 29999810 557479526 18 11 Once 1 29 0 00 13 | 1 24 24 12 Explain 12 0 0 BLOOM FILTER ON supplier (s_suppkey=?) 00 14 | 1 3286 3286 13 Blob 10000 13 0 00 15 | 1 1532 1532 14 Rewind 3 20 0 00 16 | 10000 1239344 123 15 Column 3 5 14 00 17 | 10000 484094 48 16 Ne 15 19 14 BINARY-8 52 18 | 2003 39224 19 17 Rowid 3 14 0 00 19 | 2003 72828 36 18 FilterAdd 13 0 14 1 00 20 | 10000 244614 24 19 Next 3 15 0 00 21 | 1 82 82 20 Explain 20 0 0 BLOOM FILTER ON part (p_partkey=?) 00 22 | 1 205824 205824 21 Blob 589824 16 0 00 23 | 1 2772 2772 22 Rewind 2 29 0 00 24 | 600000 91560994 152 23 Column 2 4 14 00 25 | 600000 26775776 44 24 Lt 18 28 14 BINARY-8 52 26 | 448318 16576328 36 25 Gt 19 28 14 BINARY-8 52 27 | 4798 131182 27 26 Rowid 2 14 0 00 28 | 4798 163122 33 27 FilterAdd 16 0 14 1 00 29 | 600000 12533630 20 28 Next 2 23 0 00 30 | 29999810 3559689476 118 29 Column 0 4 20 00 31 | 29999810 1287745512 42 30 Filter 13 48 20 1 00 32 | 6010822 152761692 25 31 Column 0 3 14 00 33 | 6010822 221977096 36 32 Filter 16 48 14 1 00 34 | 48682 43712044 897 33 SeekRowid 3 48 20 00 35 | 48682 4718650 96 34 Column 3 5 17 00 36 | 48682 2326504 47 35 Ne 15 48 17 BINARY-8 52 37 | 48682 1689710 34 36 Column 0 5 21 00 38 | 48682 34866438 716 37 SeekRowid 1 48 21 00 39 | 48682 1208228 24 38 Column 0 3 22 00 40 | 48682 98319552 2019 39 SeekRowid 2 48 22 00 41 | 48682 3896790 80 40 Column 2 4 17 00 42 | 48682 2182742 44 41 Lt 18 48 17 BINARY-8 52 43 | 48340 2167964 44 42 Gt 19 48 17 BINARY-8 52 44 | 47381 3288380 69 43 Column 1 4 24 00 45 | 47381 1312708 27 44 Column 2 4 25 00 46 | 47381 2269416 47 45 Column 0 12 26 00 47 | 47381 3226086 68 46 MakeRecord 24 3 17 00 48 | 47381 1380218 29 47 SorterInsert 5 17 0 00 49 | 29999810 630199842 21 48 Next 0 11 0 01 50 | 1 1010 1010 49 OpenPseudo 6 17 3 00 51 | 1 46868138 46868138 50 SorterSort 5 80 0 00 52 | 47381 888424 18 51 SorterData 5 17 6 00 53 | 47381 1699320 35 52 Column 6 0 11 00 54 | 47381 1779804 37 53 Column 6 1 12 00 55 | 47381 2052188 43 54 Compare 9 11 2 k(2,B,B) 00 56 | 47381 876250 18 55 Jump 56 60 56 00 57 | 56 2498 44 56 Move 11 9 2 00 58 | 56 1328 23 57 Gosub 7 71 0 00 59 | 56 1038 18 58 IfPos 6 80 0 00 60 | 56 1064 19 59 Gosub 8 77 0 00 61 | 47381 1586914 33 60 Column 6 2 23 00 62 | 47381 1004394 21 61 AggStep1 0 23 1 sum(1) 01 63 | 47381 871358 18 62 If 5 65 0 00 64 | 56 1130 20 63 Column 6 0 2 00 65 | 56 1848 33 64 Column 6 1 3 00 66 | 47381 869158 18 65 Integer 1 5 0 00 67 | 47381 870772 18 66 SorterNext 5 51 0 00 68 | 1 36 36 67 Gosub 7 71 0 00 69 | 1 30 30 68 Goto 0 80 0 00 70 | 0 0 0 69 Integer 1 6 0 00 71 | 0 0 0 70 Return 7 0 0 00 72 | 57 1532 26 71 IfPos 5 73 0 00 73 | 1 236 236 72 Return 7 0 0 00 74 | 56 3342 59 73 AggFinal 1 1 0 sum(1) 00 75 | 56 6910 123 74 Copy 1 27 2 00 76 | 0 0 0 75 ResultRow 27 3 0 00 77 | 56 1494 26 76 Return 7 0 0 00 78 | 57 2602 45 77 Null 0 1 4 00 79 | 57 1290 22 78 Integer 0 5 0 00 80 | 57 1052 18 79 Return 8 0 0 00 81 | 0 0 0 80 Halt 0 0 0 00 82 | 1 33356 33356 81 Transaction 0 0 6 0 01 83 | 1 158 158 82 String 4 15 0 ASIA 00 84 | 1 58 58 83 String 9 18 0 MFGR#2221 00 85 | 1 20 20 84 String 9 19 0 MFGR#2228 00 86 | 1 48 48 85 Goto 0 1 0 00 87 | -------------------------------------------------------------------------------- /analysis/data/ssb/profiles/bloom/Q2.3.txt: -------------------------------------------------------------------------------- 1 | 1 172 172 0 Init 1 79 0 00 2 | 1 102 102 1 Noop 4 6 0 00 3 | 1 1782 1782 2 SorterOpen 5 3 0 k(2,B,B) 00 4 | 1 20 20 3 Integer 0 6 0 00 5 | 1 62 62 4 Null 0 9 10 00 6 | 1 50 50 5 Gosub 8 75 0 00 7 | 1 726 726 6 OpenRead 0 7 0 13 00 8 | 1 122 122 7 OpenRead 3 4 0 7 00 9 | 1 164 164 8 OpenRead 1 6 0 5 00 10 | 1 108 108 9 OpenRead 2 3 0 9 00 11 | 1 4206 4206 10 Rewind 0 47 0 00 12 | 29999810 557738814 18 11 Once 1 28 0 00 13 | 1 26 26 12 Explain 12 0 0 BLOOM FILTER ON supplier (s_suppkey=?) 00 14 | 1 2670 2670 13 Blob 10000 13 0 00 15 | 1 684 684 14 Rewind 3 20 0 00 16 | 10000 1134342 113 15 Column 3 5 14 00 17 | 10000 426832 42 16 Ne 15 19 14 BINARY-8 52 18 | 1987 75396 37 17 Rowid 3 14 0 00 19 | 1987 73766 37 18 FilterAdd 13 0 14 1 00 20 | 10000 222710 22 19 Next 3 15 0 00 21 | 1 88 88 20 Explain 20 0 0 BLOOM FILTER ON part (p_partkey=?) 00 22 | 1 179784 179784 21 Blob 589824 16 0 00 23 | 1 1208 1208 22 Rewind 2 28 0 00 24 | 600000 81659366 136 23 Column 2 4 14 00 25 | 600000 29337400 48 24 Ne 17 27 14 BINARY-8 52 26 | 615 30326 49 25 Rowid 2 14 0 00 27 | 615 21426 34 26 FilterAdd 16 0 14 1 00 28 | 600000 12615930 21 27 Next 2 23 0 00 29 | 29999810 3507049654 116 28 Column 0 4 18 00 30 | 29999810 1292707046 43 29 Filter 13 46 18 1 00 31 | 5957277 156115308 26 30 Column 0 3 14 00 32 | 5957277 219327388 36 31 Filter 16 46 14 1 00 33 | 6010 6843598 1138 32 SeekRowid 3 46 18 00 34 | 6010 779046 129 33 Column 3 5 19 00 35 | 6010 476090 79 34 Ne 15 46 19 BINARY-8 52 36 | 6010 257926 42 35 Column 0 5 20 00 37 | 6010 5295044 881 36 SeekRowid 1 46 20 00 38 | 6010 142384 23 37 Column 0 3 21 00 39 | 6010 12796304 2129 38 SeekRowid 2 46 21 00 40 | 6010 533284 88 39 Column 2 4 19 00 41 | 6010 254998 42 40 Ne 17 46 19 BINARY-8 52 42 | 5891 422426 71 41 Column 1 4 22 00 43 | 5891 185752 31 42 Column 2 4 23 00 44 | 5891 301840 51 43 Column 0 12 24 00 45 | 5891 562614 95 44 MakeRecord 22 3 19 00 46 | 5891 244300 41 45 SorterInsert 5 19 0 00 47 | 29999810 640223376 21 46 Next 0 11 0 01 48 | 1 842 842 47 OpenPseudo 6 19 3 00 49 | 1 2639336 2639336 48 SorterSort 5 78 0 00 50 | 5891 117064 19 49 SorterData 5 19 6 00 51 | 5891 214620 36 50 Column 6 0 11 00 52 | 5891 224794 38 51 Column 6 1 12 00 53 | 5891 257476 43 52 Compare 9 11 2 k(2,B,B) 00 54 | 5891 108412 18 53 Jump 54 58 54 00 55 | 7 748 106 54 Move 11 9 2 00 56 | 7 392 56 55 Gosub 7 69 0 00 57 | 7 126 18 56 IfPos 6 78 0 00 58 | 7 156 22 57 Gosub 8 75 0 00 59 | 5891 196280 33 58 Column 6 2 25 00 60 | 5891 126926 21 59 AggStep1 0 25 1 sum(1) 01 61 | 5891 109336 18 60 If 5 63 0 00 62 | 7 226 32 61 Column 6 0 2 00 63 | 7 322 46 62 Column 6 1 3 00 64 | 5891 108068 18 63 Integer 1 5 0 00 65 | 5891 109686 18 64 SorterNext 5 49 0 00 66 | 1 20 20 65 Gosub 7 69 0 00 67 | 1 34 34 66 Goto 0 78 0 00 68 | 0 0 0 67 Integer 1 6 0 00 69 | 0 0 0 68 Return 7 0 0 00 70 | 8 502 62 69 IfPos 5 71 0 00 71 | 1 98 98 70 Return 7 0 0 00 72 | 7 740 105 71 AggFinal 1 1 0 sum(1) 00 73 | 7 1044 149 72 Copy 1 26 2 00 74 | 0 0 0 73 ResultRow 26 3 0 00 75 | 7 154 22 74 Return 7 0 0 00 76 | 8 526 65 75 Null 0 1 4 00 77 | 8 242 30 76 Integer 0 5 0 00 78 | 8 160 20 77 Return 8 0 0 00 79 | 0 0 0 78 Halt 0 0 0 00 80 | 1 34982 34982 79 Transaction 0 0 6 0 01 81 | 1 198 198 80 String 6 15 0 EUROPE 00 82 | 1 72 72 81 String 9 17 0 MFGR#2221 00 83 | 1 86 86 82 Goto 0 1 0 00 84 | -------------------------------------------------------------------------------- /analysis/data/ssb/profiles/vanilla/Q1.1.txt: -------------------------------------------------------------------------------- 1 | 1 148 148 0 Init 1 23 0 00 2 | 1 478 478 1 Null 0 1 3 00 3 | 1 426 426 2 OpenRead 0 7 0 12 00 4 | 1 180 180 3 OpenRead 1 6 0 5 00 5 | 1 3130 3130 4 Rewind 0 19 0 00 6 | 29999810 4585484654 152 5 Column 0 11 4 00 7 | 29999810 609776610 20 6 Lt 6 18 4 BINARY-8 54 8 | 27273158 631683212 23 7 Gt 7 18 4 BINARY-8 54 9 | 8181061 173654594 21 8 Column 0 8 4 00 10 | 8181061 238256990 29 9 Ge 8 18 4 BINARY-8 54 11 | 3925700 77830052 19 10 Column 0 5 9 00 12 | 3925700 1386429964 353 11 SeekRowid 1 18 9 00 13 | 3925700 241347586 61 12 Column 1 4 4 00 14 | 3925700 108565902 27 13 Ne 10 18 4 BINARY-8 54 15 | 595746 12956882 21 14 Column 0 9 5 00 16 | 595746 17742822 29 15 Column 0 11 11 00 17 | 595746 11029852 18 16 Multiply 11 5 4 00 18 | 595746 16301184 27 17 AggStep1 0 4 1 sum(1) 01 19 | 29999810 608460416 20 18 Next 0 5 0 01 20 | 1 1190 1190 19 AggFinal 1 1 0 sum(1) 00 21 | 1 1376 1376 20 Copy 1 12 0 00 22 | 0 0 0 21 ResultRow 12 1 0 00 23 | 0 0 0 22 Halt 0 0 0 00 24 | 1 18812 18812 23 Transaction 0 0 6 0 01 25 | 1 56 56 24 Integer 1 6 0 00 26 | 1 20 20 25 Integer 3 7 0 00 27 | 1 18 18 26 Integer 25 8 0 00 28 | 1 18 18 27 Integer 1993 10 0 00 29 | 1 34 34 28 Goto 0 1 0 00 30 | -------------------------------------------------------------------------------- /analysis/data/ssb/profiles/vanilla/Q1.2.txt: -------------------------------------------------------------------------------- 1 | 1 156 156 0 Init 1 24 0 00 2 | 1 282 282 1 Null 0 1 3 00 3 | 1 754 754 2 OpenRead 0 7 0 12 00 4 | 1 132 132 3 OpenRead 1 6 0 6 00 5 | 1 39046 39046 4 Rewind 0 20 0 00 6 | 29999810 4476821412 149 5 Column 0 11 4 00 7 | 29999810 790994646 26 6 Lt 6 19 4 BINARY-8 54 8 | 19092097 488833756 25 7 Gt 7 19 4 BINARY-8 54 9 | 8181896 164239332 20 8 Column 0 8 4 00 10 | 8181896 252292728 30 9 Lt 8 19 4 BINARY-8 54 11 | 4091990 106785038 26 10 Gt 9 19 4 BINARY-8 54 12 | 1636207 30964372 18 11 Column 0 5 10 00 13 | 1636207 672407878 410 12 SeekRowid 1 19 10 00 14 | 1636207 108184398 66 13 Column 1 5 4 00 15 | 1636207 43634140 26 14 Ne 11 19 4 BINARY-8 54 16 | 21202 438348 20 15 Column 0 9 5 00 17 | 21202 391706 18 16 Column 0 11 12 00 18 | 21202 441348 20 17 Multiply 12 5 4 00 19 | 21202 1383902 65 18 AggStep1 0 4 1 sum(1) 01 20 | 29999810 614132484 20 19 Next 0 5 0 01 21 | 1 1140 1140 20 AggFinal 1 1 0 sum(1) 00 22 | 1 426 426 21 Copy 1 13 0 00 23 | 0 0 0 22 ResultRow 13 1 0 00 24 | 0 0 0 23 Halt 0 0 0 00 25 | 1 32114 32114 24 Transaction 0 0 6 0 01 26 | 1 90 90 25 Integer 4 6 0 00 27 | 1 18 18 26 Integer 6 7 0 00 28 | 1 18 18 27 Integer 26 8 0 00 29 | 1 16 16 28 Integer 35 9 0 00 30 | 1 18 18 29 Integer 199401 11 0 00 31 | 1 84 84 30 Goto 0 1 0 00 32 | -------------------------------------------------------------------------------- /analysis/data/ssb/profiles/vanilla/Q1.3.txt: -------------------------------------------------------------------------------- 1 | 1 126 126 0 Init 1 26 0 00 2 | 1 484 484 1 Null 0 1 3 00 3 | 1 36844 36844 2 OpenRead 0 7 0 12 00 4 | 1 108 108 3 OpenRead 1 6 0 12 00 5 | 1 4134 4134 4 Rewind 0 22 0 00 6 | 29999810 4264039030 142 5 Column 0 11 4 00 7 | 29999810 857195176 28 6 Lt 6 21 4 BINARY-8 54 8 | 16364521 439326456 26 7 Gt 7 21 4 BINARY-8 54 9 | 8182849 161411094 19 8 Column 0 8 4 00 10 | 8182849 214293262 26 9 Lt 8 21 4 BINARY-8 54 11 | 2456807 60694040 24 10 Gt 9 21 4 BINARY-8 54 12 | 819552 15489284 18 11 Column 0 5 10 00 13 | 819552 375270646 457 12 SeekRowid 1 21 10 00 14 | 819552 67560972 82 13 Column 1 11 4 00 15 | 819552 25943626 31 14 Ne 11 21 4 BINARY-8 54 16 | 16635 801724 48 15 Column 1 4 4 00 17 | 16635 536730 32 16 Ne 12 21 4 BINARY-8 54 18 | 2374 48572 20 17 Column 0 9 5 00 19 | 2374 44302 18 18 Column 0 11 13 00 20 | 2374 73976 31 19 Multiply 13 5 4 00 21 | 2374 359310 151 20 AggStep1 0 4 1 sum(1) 01 22 | 29999810 619489982 20 21 Next 0 5 0 01 23 | 1 994 994 22 AggFinal 1 1 0 sum(1) 00 24 | 1 594 594 23 Copy 1 14 0 00 25 | 0 0 0 24 ResultRow 14 1 0 00 26 | 0 0 0 25 Halt 0 0 0 00 27 | 1 28698 28698 26 Transaction 0 0 6 0 01 28 | 1 52 52 27 Integer 5 6 0 00 29 | 1 16 16 28 Integer 7 7 0 00 30 | 1 38 38 29 Integer 36 8 0 00 31 | 1 18 18 30 Integer 40 9 0 00 32 | 1 18 18 31 Integer 6 11 0 00 33 | 1 20 20 32 Integer 1994 12 0 00 34 | 1 32 32 33 Goto 0 1 0 00 35 | -------------------------------------------------------------------------------- /analysis/data/ssb/profiles/vanilla/Q2.1.txt: -------------------------------------------------------------------------------- 1 | 1 184 184 0 Init 1 59 0 00 2 | 1 108 108 1 Noop 4 6 0 00 3 | 1 1608 1608 2 SorterOpen 5 3 0 k(2,B,B) 00 4 | 1 64 64 3 Integer 0 6 0 00 5 | 1 454 454 4 Null 0 9 10 00 6 | 1 56 56 5 Gosub 8 55 0 00 7 | 1 652 652 6 OpenRead 0 7 0 13 00 8 | 1 172 172 7 OpenRead 3 4 0 6 00 9 | 1 246 246 8 OpenRead 1 6 0 5 00 10 | 1 260 260 9 OpenRead 2 3 0 5 00 11 | 1 3952 3952 10 Rewind 0 27 0 00 12 | 29999810 4871362460 162 11 Column 0 4 13 00 13 | 29999810 15517964164 517 12 SeekRowid 3 26 13 00 14 | 29999810 2402044382 80 13 Column 3 5 14 00 15 | 29999810 1463423322 48 14 Ne 15 26 14 BINARY-8 52 16 | 6110928 208526132 34 15 Column 0 5 16 00 17 | 6110928 2335042106 382 16 SeekRowid 1 26 16 00 18 | 6110928 151886134 24 17 Column 0 3 17 00 19 | 6110928 9110094426 1490 18 SeekRowid 2 26 17 00 20 | 6110928 459554126 75 19 Column 2 3 14 00 21 | 6110928 252588426 41 20 Ne 18 26 14 BINARY-8 52 22 | 248554 23344028 93 21 Column 1 4 19 00 23 | 248554 9134442 36 22 Column 2 4 20 00 24 | 248554 11875556 47 23 Column 0 12 21 00 25 | 248554 19545756 78 24 MakeRecord 19 3 14 00 26 | 248554 34642002 139 25 SorterInsert 5 14 0 00 27 | 29999810 628569860 20 26 Next 0 11 0 01 28 | 1 1382 1382 27 OpenPseudo 6 14 3 00 29 | 1 321957362 321957362 28 SorterSort 5 58 0 00 30 | 248554 4649362 18 29 SorterData 5 14 6 00 31 | 248554 8969568 36 30 Column 6 0 11 00 32 | 248554 9312964 37 31 Column 6 1 12 00 33 | 248554 10674374 42 32 Compare 9 11 2 k(2,B,B) 00 34 | 248554 4596760 18 33 Jump 34 38 34 00 35 | 280 11142 39 34 Move 11 9 2 00 36 | 280 5670 20 35 Gosub 7 49 0 00 37 | 280 5212 18 36 IfPos 6 58 0 00 38 | 280 5144 18 37 Gosub 8 55 0 00 39 | 248554 8428988 33 38 Column 6 2 22 00 40 | 248554 5301988 21 39 AggStep1 0 22 1 sum(1) 01 41 | 248554 4601032 18 40 If 5 43 0 00 42 | 280 5380 19 41 Column 6 0 2 00 43 | 280 7208 25 42 Column 6 1 3 00 44 | 248554 4556698 18 43 Integer 1 5 0 00 45 | 248554 4585592 18 44 SorterNext 5 29 0 00 46 | 1 44 44 45 Gosub 7 49 0 00 47 | 1 30 30 46 Goto 0 58 0 00 48 | 0 0 0 47 Integer 1 6 0 00 49 | 0 0 0 48 Return 7 0 0 00 50 | 281 5974 21 49 IfPos 5 51 0 00 51 | 1 262 262 50 Return 7 0 0 00 52 | 280 12142 43 51 AggFinal 1 1 0 sum(1) 00 53 | 280 25838 92 52 Copy 1 23 2 00 54 | 0 0 0 53 ResultRow 23 3 0 00 55 | 280 8554 30 54 Return 7 0 0 00 56 | 281 13608 48 55 Null 0 1 4 00 57 | 281 5416 19 56 Integer 0 5 0 00 58 | 281 5162 18 57 Return 8 0 0 00 59 | 0 0 0 58 Halt 0 0 0 00 60 | 1 32084 32084 59 Transaction 0 0 6 0 01 61 | 1 322 322 60 String 7 15 0 AMERICA 00 62 | 1 88 88 61 String 7 18 0 MFGR#12 00 63 | 1 50 50 62 Goto 0 1 0 00 64 | -------------------------------------------------------------------------------- /analysis/data/ssb/profiles/vanilla/Q2.2.txt: -------------------------------------------------------------------------------- 1 | 1 230 230 0 Init 1 60 0 00 2 | 1 100 100 1 Noop 4 6 0 00 3 | 1 1456 1456 2 SorterOpen 5 3 0 k(2,B,B) 00 4 | 1 52 52 3 Integer 0 6 0 00 5 | 1 134 134 4 Null 0 9 10 00 6 | 1 48 48 5 Gosub 8 56 0 00 7 | 1 846 846 6 OpenRead 0 7 0 13 00 8 | 1 120 120 7 OpenRead 3 4 0 6 00 9 | 1 220 220 8 OpenRead 1 6 0 5 00 10 | 1 102 102 9 OpenRead 2 3 0 5 00 11 | 1 5218 5218 10 Rewind 0 28 0 00 12 | 29999810 4852682340 161 11 Column 0 4 13 00 13 | 29999810 15556919978 518 12 SeekRowid 3 27 13 00 14 | 29999810 2388429580 79 13 Column 3 5 14 00 15 | 29999810 1462193304 48 14 Ne 15 27 14 BINARY-8 52 16 | 6010822 205019318 34 15 Column 0 5 16 00 17 | 6010822 2345634300 390 16 SeekRowid 1 27 16 00 18 | 6010822 149763080 24 17 Column 0 3 17 00 19 | 6010822 8911344388 1482 18 SeekRowid 2 27 17 00 20 | 6010822 469557618 78 19 Column 2 4 14 00 21 | 6010822 292170526 48 20 Lt 19 27 14 BINARY-8 52 22 | 4490126 179519034 39 21 Gt 20 27 14 BINARY-8 52 23 | 47381 4038298 85 22 Column 1 4 21 00 24 | 47381 1606288 33 23 Column 2 4 22 00 25 | 47381 2358764 49 24 Column 0 12 23 00 26 | 47381 4976368 105 25 MakeRecord 21 3 14 00 27 | 47381 1547256 32 26 SorterInsert 5 14 0 00 28 | 29999810 628447762 20 27 Next 0 11 0 01 29 | 1 994 994 28 OpenPseudo 6 14 3 00 30 | 1 46922944 46922944 29 SorterSort 5 59 0 00 31 | 47381 881570 18 30 SorterData 5 14 6 00 32 | 47381 1699040 35 31 Column 6 0 11 00 33 | 47381 1775840 37 32 Column 6 1 12 00 34 | 47381 2049420 43 33 Compare 9 11 2 k(2,B,B) 00 35 | 47381 871466 18 34 Jump 35 39 35 00 36 | 56 2696 48 35 Move 11 9 2 00 37 | 56 1364 24 36 Gosub 7 50 0 00 38 | 56 1052 18 37 IfPos 6 59 0 00 39 | 56 1026 18 38 Gosub 8 56 0 00 40 | 47381 1606308 33 39 Column 6 2 18 00 41 | 47381 1013020 21 40 AggStep1 0 18 1 sum(1) 01 42 | 47381 882136 18 41 If 5 44 0 00 43 | 56 1168 20 42 Column 6 0 2 00 44 | 56 1542 27 43 Column 6 1 3 00 45 | 47381 868996 18 44 Integer 1 5 0 00 46 | 47381 871186 18 45 SorterNext 5 30 0 00 47 | 1 34 34 46 Gosub 7 50 0 00 48 | 1 34 34 47 Goto 0 59 0 00 49 | 0 0 0 48 Integer 1 6 0 00 50 | 0 0 0 49 Return 7 0 0 00 51 | 57 1580 27 50 IfPos 5 52 0 00 52 | 1 254 254 51 Return 7 0 0 00 53 | 56 4440 79 52 AggFinal 1 1 0 sum(1) 00 54 | 56 6418 114 53 Copy 1 24 2 00 55 | 0 0 0 54 ResultRow 24 3 0 00 56 | 56 1812 32 55 Return 7 0 0 00 57 | 57 3248 56 56 Null 0 1 4 00 58 | 57 1110 19 57 Integer 0 5 0 00 59 | 57 1060 18 58 Return 8 0 0 00 60 | 0 0 0 59 Halt 0 0 0 00 61 | 1 37326 37326 60 Transaction 0 0 6 0 01 62 | 1 404 404 61 String 4 15 0 ASIA 00 63 | 1 122 122 62 String 9 19 0 MFGR#2221 00 64 | 1 50 50 63 String 9 20 0 MFGR#2228 00 65 | 1 32 32 64 Goto 0 1 0 00 66 | -------------------------------------------------------------------------------- /analysis/data/ssb/profiles/vanilla/Q2.3.txt: -------------------------------------------------------------------------------- 1 | 1 206 206 0 Init 1 59 0 00 2 | 1 92 92 1 Noop 4 6 0 00 3 | 1 1608 1608 2 SorterOpen 5 3 0 k(2,B,B) 00 4 | 1 52 52 3 Integer 0 6 0 00 5 | 1 190 190 4 Null 0 9 10 00 6 | 1 58 58 5 Gosub 8 55 0 00 7 | 1 646 646 6 OpenRead 0 7 0 13 00 8 | 1 134 134 7 OpenRead 3 4 0 6 00 9 | 1 220 220 8 OpenRead 1 6 0 5 00 10 | 1 88 88 9 OpenRead 2 3 0 5 00 11 | 1 4226 4226 10 Rewind 0 27 0 00 12 | 29999810 4806619878 160 11 Column 0 4 13 00 13 | 29999810 15585271358 519 12 SeekRowid 3 26 13 00 14 | 29999810 2385874356 79 13 Column 3 5 14 00 15 | 29999810 1328125608 44 14 Ne 15 26 14 BINARY-8 52 16 | 5957277 203688454 34 15 Column 0 5 16 00 17 | 5957277 2399098132 402 16 SeekRowid 1 26 16 00 18 | 5957277 146832202 24 17 Column 0 3 17 00 19 | 5957277 8850901422 1485 18 SeekRowid 2 26 17 00 20 | 5957277 457561442 76 19 Column 2 4 14 00 21 | 5957277 299562898 50 20 Ne 18 26 14 BINARY-8 52 22 | 5891 577182 97 21 Column 1 4 19 00 23 | 5891 229560 38 22 Column 2 4 20 00 24 | 5891 291806 49 23 Column 0 12 21 00 25 | 5891 970508 164 24 MakeRecord 19 3 14 00 26 | 5891 393624 66 25 SorterInsert 5 14 0 00 27 | 29999810 641512872 21 26 Next 0 11 0 01 28 | 1 1436 1436 27 OpenPseudo 6 14 3 00 29 | 1 2656436 2656436 28 SorterSort 5 58 0 00 30 | 5891 112850 19 29 SorterData 5 14 6 00 31 | 5891 210994 35 30 Column 6 0 11 00 32 | 5891 222512 37 31 Column 6 1 12 00 33 | 5891 254774 43 32 Compare 9 11 2 k(2,B,B) 00 34 | 5891 108680 18 33 Jump 34 38 34 00 35 | 7 974 139 34 Move 11 9 2 00 36 | 7 372 53 35 Gosub 7 49 0 00 37 | 7 142 20 36 IfPos 6 58 0 00 38 | 7 152 21 37 Gosub 8 55 0 00 39 | 5891 197070 33 38 Column 6 2 22 00 40 | 5891 128042 21 39 AggStep1 0 22 1 sum(1) 01 41 | 5891 110324 18 40 If 5 43 0 00 42 | 7 242 34 41 Column 6 0 2 00 43 | 7 256 36 42 Column 6 1 3 00 44 | 5891 108088 18 43 Integer 1 5 0 00 45 | 5891 108304 18 44 SorterNext 5 29 0 00 46 | 1 44 44 45 Gosub 7 49 0 00 47 | 1 32 32 46 Goto 0 58 0 00 48 | 0 0 0 47 Integer 1 6 0 00 49 | 0 0 0 48 Return 7 0 0 00 50 | 8 524 65 49 IfPos 5 51 0 00 51 | 1 234 234 50 Return 7 0 0 00 52 | 7 1030 147 51 AggFinal 1 1 0 sum(1) 00 53 | 7 2360 337 52 Copy 1 23 2 00 54 | 0 0 0 53 ResultRow 23 3 0 00 55 | 7 242 34 54 Return 7 0 0 00 56 | 8 886 110 55 Null 0 1 4 00 57 | 8 328 41 56 Integer 0 5 0 00 58 | 8 144 18 57 Return 8 0 0 00 59 | 0 0 0 58 Halt 0 0 0 00 60 | 1 38440 38440 59 Transaction 0 0 6 0 01 61 | 1 286 286 60 String 6 15 0 EUROPE 00 62 | 1 140 140 61 String 9 18 0 MFGR#2221 00 63 | 1 92 92 62 Goto 0 1 0 00 64 | -------------------------------------------------------------------------------- /analysis/data/ssb/profiles/vanilla/Q3.1.txt: -------------------------------------------------------------------------------- 1 | 1 370 370 0 Init 1 77 0 00 2 | 1 2002 2002 1 SorterOpen 4 7 0 k(2,B,-B) 00 3 | 1 954 954 2 SorterOpen 5 4 0 k(3,B,B,B) 00 4 | 1 48 48 3 Integer 0 7 0 00 5 | 1 136 136 4 Null 0 10 12 00 6 | 1 48 48 5 Gosub 9 64 0 00 7 | 1 658 658 6 OpenRead 1 7 0 13 00 8 | 1 100 100 7 OpenRead 0 5 0 6 00 9 | 1 128 128 8 OpenRead 2 4 0 6 00 10 | 1 282 282 9 OpenRead 3 6 0 5 00 11 | 1 4314 4314 10 Rewind 1 32 0 00 12 | 29999810 4513262526 150 11 Column 1 2 16 00 13 | 29999810 8552007424 285 12 SeekRowid 0 31 16 00 14 | 29999810 1962139294 65 13 Column 0 5 17 00 15 | 29999810 1327843942 44 14 Ne 18 31 17 BINARY-8 52 16 | 6022460 224187376 37 15 Column 1 4 19 00 17 | 6022460 3554616402 590 16 SeekRowid 2 31 19 00 18 | 6022460 478284982 79 17 Column 2 5 17 00 19 | 6022460 294239644 48 18 Ne 18 31 17 BINARY-8 52 20 | 1207667 66989506 55 19 Column 1 5 20 00 21 | 1207667 573193070 474 20 SeekRowid 3 31 20 00 22 | 1207667 81998014 67 21 Column 3 4 17 00 23 | 1207667 27119170 22 22 Lt 21 31 17 BINARY-8 54 24 | 1207667 23891216 19 23 Column 3 4 17 00 25 | 1207667 30043936 24 24 Gt 22 31 17 BINARY-8 54 26 | 1100175 34948354 31 25 Column 0 4 23 00 27 | 1100175 42388838 38 26 Column 2 4 24 00 28 | 1100175 24375684 22 27 Column 3 4 25 00 29 | 1100175 51594120 46 28 Column 1 12 26 00 30 | 1100175 101470674 92 29 MakeRecord 23 4 17 00 31 | 1100175 133831162 121 30 SorterInsert 5 17 0 00 32 | 29999810 639195556 21 31 Next 1 11 0 01 33 | 1 1116 1116 32 OpenPseudo 6 17 4 00 34 | 1 2462093886 2462093886 33 SorterSort 5 67 0 00 35 | 1100175 20638994 18 34 SorterData 5 17 6 00 36 | 1100175 44878794 40 35 Column 6 0 13 00 37 | 1100175 41749686 37 36 Column 6 1 14 00 38 | 1100175 33555858 30 37 Column 6 2 15 00 39 | 1100175 75286980 68 38 Compare 10 13 3 k(3,B,B,B) 00 40 | 1100175 20238892 18 39 Jump 40 44 40 00 41 | 150 14940 99 40 Move 13 10 3 00 42 | 150 3394 22 41 Gosub 8 56 0 00 43 | 150 2800 18 42 IfPos 7 67 0 00 44 | 150 2822 18 43 Gosub 9 64 0 00 45 | 1100175 36629398 33 44 Column 6 3 27 00 46 | 1100175 22857058 20 45 AggStep1 0 27 4 sum(1) 01 47 | 1100175 20584620 18 46 If 6 50 0 00 48 | 150 4068 27 47 Column 6 0 1 00 49 | 150 5332 35 48 Column 6 1 2 00 50 | 150 3260 21 49 Column 6 2 3 00 51 | 1100175 20276028 18 50 Integer 1 6 0 00 52 | 1100175 20289004 18 51 SorterNext 5 34 0 00 53 | 1 44 44 52 Gosub 8 56 0 00 54 | 1 30 30 53 Goto 0 67 0 00 55 | 0 0 0 54 Integer 1 7 0 00 56 | 0 0 0 55 Return 8 0 0 00 57 | 151 6534 43 56 IfPos 6 58 0 00 58 | 1 258 258 57 Return 8 0 0 00 59 | 150 19906 132 58 AggFinal 4 1 0 sum(1) 00 60 | 150 36998 246 59 Copy 1 30 1 00 61 | 150 6366 42 60 Copy 3 28 1 00 62 | 150 29524 196 61 MakeRecord 28 4 34 00 63 | 150 17468 116 62 SorterInsert 4 34 28 4 00 64 | 150 2858 19 63 Return 8 0 0 00 65 | 151 3632 24 64 Null 0 1 5 00 66 | 151 3018 19 65 Integer 0 6 0 00 67 | 151 2796 18 66 Return 9 0 0 00 68 | 1 1672 1672 67 OpenPseudo 7 35 7 00 69 | 1 58462 58462 68 SorterSort 4 76 0 00 70 | 150 3162 21 69 SorterData 4 35 7 00 71 | 150 6176 41 70 Column 7 1 33 00 72 | 150 2880 19 71 Column 7 0 32 00 73 | 150 6666 44 72 Column 7 3 31 00 74 | 150 4470 29 73 Column 7 2 30 00 75 | 0 0 0 74 ResultRow 30 4 0 00 76 | 150 3464 23 75 SorterNext 4 69 0 00 77 | 0 0 0 76 Halt 0 0 0 00 78 | 1 37590 37590 77 Transaction 0 0 6 0 01 79 | 1 146 146 78 String 4 18 0 ASIA 00 80 | 1 40 40 79 Integer 1992 21 0 00 81 | 1 20 20 80 Integer 1997 22 0 00 82 | 1 42 42 81 Goto 0 1 0 00 83 | -------------------------------------------------------------------------------- /analysis/data/ssb/profiles/vanilla/Q3.2.txt: -------------------------------------------------------------------------------- 1 | 1 358 358 0 Init 1 77 0 00 2 | 1 1620 1620 1 SorterOpen 4 7 0 k(2,B,-B) 00 3 | 1 634 634 2 SorterOpen 5 4 0 k(3,B,B,B) 00 4 | 1 48 48 3 Integer 0 7 0 00 5 | 1 194 194 4 Null 0 10 12 00 6 | 1 64 64 5 Gosub 9 64 0 00 7 | 1 1150 1150 6 OpenRead 1 7 0 13 00 8 | 1 222 222 7 OpenRead 0 5 0 5 00 9 | 1 130 130 8 OpenRead 2 4 0 5 00 10 | 1 288 288 9 OpenRead 3 6 0 5 00 11 | 1 7040 7040 10 Rewind 1 32 0 00 12 | 29999810 4327913474 144 11 Column 1 2 16 00 13 | 29999810 8288570372 276 12 SeekRowid 0 31 16 00 14 | 29999810 1916436552 63 13 Column 0 4 17 00 15 | 29999810 1170317858 39 14 Ne 18 31 17 BINARY-8 52 16 | 1197451 42551070 35 15 Column 1 4 19 00 17 | 1197451 862990178 720 16 SeekRowid 2 31 19 00 18 | 1197451 97025278 81 17 Column 2 4 17 00 19 | 1197451 48693298 40 18 Ne 18 31 17 BINARY-8 52 20 | 47036 2916894 62 19 Column 1 5 20 00 21 | 47036 51616686 1097 20 SeekRowid 3 31 20 00 22 | 47036 5166516 109 21 Column 3 4 17 00 23 | 47036 1384164 29 22 Lt 21 31 17 BINARY-8 54 24 | 47036 934662 19 23 Column 3 4 17 00 25 | 47036 1346736 28 24 Gt 22 31 17 BINARY-8 54 26 | 42843 1225820 28 25 Column 0 3 23 00 27 | 42843 1557954 36 26 Column 2 3 24 00 28 | 42843 828438 19 27 Column 3 4 25 00 29 | 42843 2055416 47 28 Column 1 12 26 00 30 | 42843 4800076 112 29 MakeRecord 23 4 17 00 31 | 42843 1586876 37 30 SorterInsert 5 17 0 00 32 | 29999810 649820404 21 31 Next 1 11 0 01 33 | 1 1302 1302 32 OpenPseudo 6 17 4 00 34 | 1 58424310 58424310 33 SorterSort 5 67 0 00 35 | 42843 798504 18 34 SorterData 5 17 6 00 36 | 42843 1758654 41 35 Column 6 0 13 00 37 | 42843 1621492 37 36 Column 6 1 14 00 38 | 42843 1314984 30 37 Column 6 2 15 00 39 | 42843 3049122 71 38 Compare 10 13 3 k(3,B,B,B) 00 40 | 42843 785678 18 39 Jump 40 44 40 00 41 | 600 26942 44 40 Move 13 10 3 00 42 | 600 11448 19 41 Gosub 8 56 0 00 43 | 600 11194 18 42 IfPos 7 67 0 00 44 | 600 11064 18 43 Gosub 9 64 0 00 45 | 42843 1442598 33 44 Column 6 3 27 00 46 | 42843 976212 22 45 AggStep1 0 27 4 sum(1) 01 47 | 42843 799788 18 46 If 6 50 0 00 48 | 600 14668 24 47 Column 6 0 1 00 49 | 600 18226 30 48 Column 6 1 2 00 50 | 600 11294 18 49 Column 6 2 3 00 51 | 42843 785490 18 50 Integer 1 6 0 00 52 | 42843 793912 18 51 SorterNext 5 34 0 00 53 | 1 36 36 52 Gosub 8 56 0 00 54 | 1 30 30 53 Goto 0 67 0 00 55 | 0 0 0 54 Integer 1 7 0 00 56 | 0 0 0 55 Return 8 0 0 00 57 | 601 11692 19 56 IfPos 6 58 0 00 58 | 1 246 246 57 Return 8 0 0 00 59 | 600 25786 42 58 AggFinal 4 1 0 sum(1) 00 60 | 600 57996 96 59 Copy 1 30 1 00 61 | 600 17260 28 60 Copy 3 28 1 00 62 | 600 49688 82 61 MakeRecord 28 4 34 00 63 | 600 25392 42 62 SorterInsert 4 34 28 4 00 64 | 600 11242 18 63 Return 8 0 0 00 65 | 601 12522 20 64 Null 0 1 5 00 66 | 601 11762 19 65 Integer 0 6 0 00 67 | 601 10978 18 66 Return 9 0 0 00 68 | 1 504 504 67 OpenPseudo 7 35 7 00 69 | 1 256578 256578 68 SorterSort 4 76 0 00 70 | 600 11634 19 69 SorterData 4 35 7 00 71 | 600 23198 38 70 Column 7 1 33 00 72 | 600 11286 18 71 Column 7 0 32 00 73 | 600 22426 37 72 Column 7 3 31 00 74 | 600 13186 21 73 Column 7 2 30 00 75 | 0 0 0 74 ResultRow 30 4 0 00 76 | 600 12330 20 75 SorterNext 4 69 0 00 77 | 0 0 0 76 Halt 0 0 0 00 78 | 1 37312 37312 77 Transaction 0 0 6 0 01 79 | 1 184 184 78 String 13 18 0 UNITED STATES 00 80 | 1 44 44 79 Integer 1992 21 0 00 81 | 1 20 20 80 Integer 1997 22 0 00 82 | 1 48 48 81 Goto 0 1 0 00 83 | -------------------------------------------------------------------------------- /analysis/data/ssb/profiles/vanilla/Q3.3.txt: -------------------------------------------------------------------------------- 1 | 1 188 188 0 Init 1 81 0 00 2 | 1 1708 1708 1 SorterOpen 4 7 0 k(2,B,-B) 00 3 | 1 500 500 2 SorterOpen 5 4 0 k(3,B,B,B) 00 4 | 1 48 48 3 Integer 0 7 0 00 5 | 1 140 140 4 Null 0 10 12 00 6 | 1 40 40 5 Gosub 9 68 0 00 7 | 1 692 692 6 OpenRead 1 7 0 13 00 8 | 1 178 178 7 OpenRead 0 5 0 4 00 9 | 1 112 112 8 OpenRead 2 4 0 4 00 10 | 1 228 228 9 OpenRead 3 6 0 5 00 11 | 1 4412 4412 10 Rewind 1 36 0 00 12 | 29999810 4513167414 150 11 Column 1 2 16 00 13 | 29999810 8191039580 273 12 SeekRowid 0 35 16 00 14 | 29999810 1737388650 57 13 Column 0 3 17 00 15 | 29999810 1106803362 36 14 Eq 18 17 17 BINARY-8 42 16 | 29888617 907322216 30 15 Column 0 3 17 00 17 | 29888617 1159642096 38 16 Ne 19 35 17 BINARY-8 52 18 | 233662 8323490 35 17 Column 1 4 20 00 19 | 233662 225994992 967 18 SeekRowid 2 35 20 00 20 | 233662 16000754 68 19 Column 2 3 17 00 21 | 233662 9091926 38 20 Eq 18 23 17 BINARY-8 42 22 | 232777 7094716 30 21 Column 2 3 17 00 23 | 232777 9573506 41 22 Ne 19 35 17 BINARY-8 52 24 | 1742 138244 79 23 Column 1 5 21 00 25 | 1742 4525114 2597 24 SeekRowid 3 35 21 00 26 | 1742 217220 124 25 Column 3 4 17 00 27 | 1742 169784 97 26 Lt 22 35 17 BINARY-8 54 28 | 1742 40654 23 27 Column 3 4 17 00 29 | 1742 91332 52 28 Gt 23 35 17 BINARY-8 54 30 | 1597 70088 43 29 Column 0 3 24 00 31 | 1597 62542 39 30 Column 2 3 25 00 32 | 1597 47294 29 31 Column 3 4 26 00 33 | 1597 80696 50 32 Column 1 12 27 00 34 | 1597 380938 238 33 MakeRecord 24 4 17 00 35 | 1597 167584 104 34 SorterInsert 5 17 0 00 36 | 29999810 699007402 23 35 Next 1 11 0 01 37 | 1 1128 1128 36 OpenPseudo 6 17 4 00 38 | 1 1538176 1538176 37 SorterSort 5 71 0 00 39 | 1597 30220 18 38 SorterData 5 17 6 00 40 | 1597 67462 42 39 Column 6 0 13 00 41 | 1597 61464 38 40 Column 6 1 14 00 42 | 1597 49070 30 41 Column 6 2 15 00 43 | 1597 114530 71 42 Compare 10 13 3 k(3,B,B,B) 00 44 | 1597 30098 18 43 Jump 44 48 44 00 45 | 24 1974 82 44 Move 13 10 3 00 46 | 24 706 29 45 Gosub 8 60 0 00 47 | 24 480 20 46 IfPos 7 71 0 00 48 | 24 456 19 47 Gosub 9 68 0 00 49 | 1597 53968 33 48 Column 6 3 28 00 50 | 1597 39270 24 49 AggStep1 0 28 4 sum(1) 01 51 | 1597 30218 18 50 If 6 54 0 00 52 | 24 808 33 51 Column 6 0 1 00 53 | 24 818 34 52 Column 6 1 2 00 54 | 24 492 20 53 Column 6 2 3 00 55 | 1597 29282 18 54 Integer 1 6 0 00 56 | 1597 29474 18 55 SorterNext 5 38 0 00 57 | 1 38 38 56 Gosub 8 60 0 00 58 | 1 32 32 57 Goto 0 71 0 00 59 | 0 0 0 58 Integer 1 7 0 00 60 | 0 0 0 59 Return 8 0 0 00 61 | 25 1390 55 60 IfPos 6 62 0 00 62 | 1 422 422 61 Return 8 0 0 00 63 | 24 1504 62 62 AggFinal 4 1 0 sum(1) 00 64 | 24 3646 151 63 Copy 1 31 1 00 65 | 24 924 38 64 Copy 3 29 1 00 66 | 24 2566 106 65 MakeRecord 29 4 35 00 67 | 24 1386 57 66 SorterInsert 4 35 29 4 00 68 | 24 470 19 67 Return 8 0 0 00 69 | 25 1298 51 68 Null 0 1 5 00 70 | 25 702 28 69 Integer 0 6 0 00 71 | 25 450 18 70 Return 9 0 0 00 72 | 1 74 74 71 OpenPseudo 7 36 7 00 73 | 1 7094 7094 72 SorterSort 4 80 0 00 74 | 24 818 34 73 SorterData 4 36 7 00 75 | 24 1068 44 74 Column 7 1 34 00 76 | 24 550 22 75 Column 7 0 33 00 77 | 24 1032 43 76 Column 7 3 32 00 78 | 24 562 23 77 Column 7 2 31 00 79 | 0 0 0 78 ResultRow 31 4 0 00 80 | 24 568 23 79 SorterNext 4 73 0 00 81 | 0 0 0 80 Halt 0 0 0 00 82 | 1 37776 37776 81 Transaction 0 0 6 0 01 83 | 1 284 284 82 String 10 18 0 UNITED KI1 00 84 | 1 134 134 83 String 10 19 0 UNITED KI5 00 85 | 1 52 52 84 Integer 1992 22 0 00 86 | 1 20 20 85 Integer 1997 23 0 00 87 | 1 48 48 86 Goto 0 1 0 00 88 | -------------------------------------------------------------------------------- /analysis/data/ssb/profiles/vanilla/Q3.4.txt: -------------------------------------------------------------------------------- 1 | 1 340 340 0 Init 1 79 0 00 2 | 1 1554 1554 1 SorterOpen 4 7 0 k(2,B,-B) 00 3 | 1 464 464 2 SorterOpen 5 4 0 k(3,B,B,B) 00 4 | 1 54 54 3 Integer 0 7 0 00 5 | 1 152 152 4 Null 0 10 12 00 6 | 1 54 54 5 Gosub 9 66 0 00 7 | 1 560 560 6 OpenRead 1 7 0 13 00 8 | 1 90 90 7 OpenRead 0 5 0 4 00 9 | 1 242 242 8 OpenRead 2 4 0 4 00 10 | 1 102 102 9 OpenRead 3 6 0 7 00 11 | 1 5396 5396 10 Rewind 1 34 0 00 12 | 29999810 4408410054 146 11 Column 1 2 16 00 13 | 29999810 8190568196 273 12 SeekRowid 0 33 16 00 14 | 29999810 1749160958 58 13 Column 0 3 17 00 15 | 29999810 1111253290 37 14 Eq 18 17 17 BINARY-8 42 16 | 29888617 906583458 30 15 Column 0 3 17 00 17 | 29888617 1155659346 38 16 Ne 19 33 17 BINARY-8 52 18 | 233662 8530822 36 17 Column 1 4 20 00 19 | 233662 226894266 971 18 SeekRowid 2 33 20 00 20 | 233662 16002582 68 19 Column 2 3 17 00 21 | 233662 9105362 38 20 Eq 18 23 17 BINARY-8 42 22 | 232777 7091186 30 21 Column 2 3 17 00 23 | 232777 20524112 88 22 Ne 19 33 17 BINARY-8 52 24 | 1742 142454 81 23 Column 1 5 21 00 25 | 1742 4445158 2551 24 SeekRowid 3 33 21 00 26 | 1742 314618 180 25 Column 3 6 17 00 27 | 1742 178402 102 26 Ne 22 33 17 BINARY-8 52 28 | 24 1710 71 27 Column 0 3 23 00 29 | 24 2868 119 28 Column 2 3 24 00 30 | 24 1388 57 29 Column 3 4 25 00 31 | 24 2096 87 30 Column 1 12 26 00 32 | 24 17508 729 31 MakeRecord 23 4 17 00 33 | 24 13904 579 32 SorterInsert 5 17 0 00 34 | 29999810 707512592 23 33 Next 1 11 0 01 35 | 1 1364 1364 34 OpenPseudo 6 17 4 00 36 | 1 18100 18100 35 SorterSort 5 69 0 00 37 | 24 1084 45 36 SorterData 5 17 6 00 38 | 24 1816 75 37 Column 6 0 13 00 39 | 24 1552 64 38 Column 6 1 14 00 40 | 24 910 37 39 Column 6 2 15 00 41 | 24 2884 120 40 Compare 10 13 3 k(3,B,B,B) 00 42 | 24 1152 48 41 Jump 42 46 42 00 43 | 4 1016 254 42 Move 13 10 3 00 44 | 4 334 83 43 Gosub 8 58 0 00 45 | 4 270 67 44 IfPos 7 69 0 00 46 | 4 92 23 45 Gosub 9 66 0 00 47 | 24 1272 53 46 Column 6 3 27 00 48 | 24 3550 147 47 AggStep1 0 27 4 sum(1) 01 49 | 24 906 37 48 If 6 52 0 00 50 | 4 240 60 49 Column 6 0 1 00 51 | 4 264 66 50 Column 6 1 2 00 52 | 4 148 37 51 Column 6 2 3 00 53 | 24 980 40 52 Integer 1 6 0 00 54 | 24 732 30 53 SorterNext 5 36 0 00 55 | 1 34 34 54 Gosub 8 58 0 00 56 | 1 32 32 55 Goto 0 69 0 00 57 | 0 0 0 56 Integer 1 7 0 00 58 | 0 0 0 57 Return 8 0 0 00 59 | 5 654 130 58 IfPos 6 60 0 00 60 | 1 238 238 59 Return 8 0 0 00 61 | 4 1062 265 60 AggFinal 4 1 0 sum(1) 00 62 | 4 1686 421 61 Copy 1 30 1 00 63 | 4 252 63 62 Copy 3 28 1 00 64 | 4 1690 422 63 MakeRecord 28 4 34 00 65 | 4 868 217 64 SorterInsert 4 34 28 4 00 66 | 4 94 23 65 Return 8 0 0 00 67 | 5 994 198 66 Null 0 1 5 00 68 | 5 316 63 67 Integer 0 6 0 00 69 | 5 92 18 68 Return 9 0 0 00 70 | 1 102 102 69 OpenPseudo 7 35 7 00 71 | 1 2092 2092 70 SorterSort 4 78 0 00 72 | 4 416 104 71 SorterData 4 35 7 00 73 | 4 452 113 72 Column 7 1 33 00 74 | 4 172 43 73 Column 7 0 32 00 75 | 4 310 77 74 Column 7 3 31 00 76 | 4 136 34 75 Column 7 2 30 00 77 | 0 0 0 76 ResultRow 30 4 0 00 78 | 4 136 34 77 SorterNext 4 71 0 00 79 | 0 0 0 78 Halt 0 0 0 00 80 | 1 37570 37570 79 Transaction 0 0 6 0 01 81 | 1 298 298 80 String 10 18 0 UNITED KI1 00 82 | 1 122 122 81 String 10 19 0 UNITED KI5 00 83 | 1 86 86 82 String 7 22 0 Dec1997 00 84 | 1 52 52 83 Goto 0 1 0 00 85 | -------------------------------------------------------------------------------- /analysis/data/ssb/profiles/vanilla/Q4.1.txt: -------------------------------------------------------------------------------- 1 | 1 210 210 0 Init 1 69 0 00 2 | 1 240 240 1 Noop 5 6 0 00 3 | 1 1298 1298 2 SorterOpen 6 4 0 k(2,B,B) 00 4 | 1 58 58 3 Integer 0 7 0 00 5 | 1 118 118 4 Null 0 10 11 00 6 | 1 54 54 5 Gosub 9 65 0 00 7 | 1 804 804 6 OpenRead 4 7 0 14 00 8 | 1 176 176 7 OpenRead 1 5 0 6 00 9 | 1 88 88 8 OpenRead 2 4 0 6 00 10 | 1 120 120 9 OpenRead 0 6 0 5 00 11 | 1 126 126 10 OpenRead 3 3 0 3 00 12 | 1 4584 4584 11 Rewind 4 35 0 00 13 | 29999810 4778128916 159 12 Column 4 2 14 00 14 | 29999810 8818066634 293 13 SeekRowid 1 34 14 00 15 | 29999810 1981859978 66 14 Column 1 5 15 00 16 | 29999810 1310344202 43 15 Ne 16 34 15 BINARY-8 52 17 | 5984970 212150794 35 16 Column 4 4 17 00 18 | 5984970 3668224092 612 17 SeekRowid 2 34 17 00 19 | 5984970 482436130 80 18 Column 2 5 15 00 20 | 5984970 290566448 48 19 Ne 16 34 15 BINARY-8 52 21 | 1220177 67093946 54 20 Column 4 5 18 00 22 | 1220177 592027902 485 21 SeekRowid 0 34 18 00 23 | 1220177 31016114 25 22 Column 4 3 19 00 24 | 1220177 2552728340 2092 23 SeekRowid 3 34 19 00 25 | 1220177 113861244 93 24 Column 3 2 15 00 26 | 1220177 78861012 64 25 Eq 20 28 15 BINARY-8 42 27 | 974540 31157706 31 26 Column 3 2 15 00 28 | 974540 46647370 47 27 Ne 21 34 15 BINARY-8 52 29 | 488778 40447512 82 28 Column 0 4 22 00 30 | 488778 24286996 49 29 Column 1 4 23 00 31 | 488778 23951962 49 30 Column 4 12 24 00 32 | 488778 15008114 30 31 Column 4 13 25 00 33 | 488778 44708548 91 32 MakeRecord 22 4 15 00 34 | 488778 44058044 90 33 SorterInsert 6 15 0 00 35 | 29999810 635645306 21 34 Next 4 12 0 01 36 | 1 1568 1568 35 OpenPseudo 7 15 4 00 37 | 1 613747852 613747852 36 SorterSort 6 68 0 00 38 | 488778 9303278 19 37 SorterData 6 15 7 00 39 | 488778 17143640 35 38 Column 7 0 12 00 40 | 488778 18305560 37 39 Column 7 1 13 00 41 | 488778 21067328 43 40 Compare 10 12 2 k(2,B,B) 00 42 | 488778 8967664 18 41 Jump 42 46 42 00 43 | 35 6386 182 42 Move 12 10 2 00 44 | 35 1196 34 43 Gosub 8 59 0 00 45 | 35 676 19 44 IfPos 7 68 0 00 46 | 35 686 19 45 Gosub 9 65 0 00 47 | 488778 16034446 32 46 Column 7 2 27 00 48 | 488778 14652924 29 47 Column 7 3 28 00 49 | 488778 9071988 18 48 Subtract 28 27 26 00 50 | 488778 10945824 22 49 AggStep1 0 26 3 sum(1) 01 51 | 488778 9017846 18 50 If 6 53 0 00 52 | 35 728 20 51 Column 7 0 1 00 53 | 35 1706 48 52 Column 7 1 2 00 54 | 488778 8960542 18 53 Integer 1 6 0 00 55 | 488778 9008004 18 54 SorterNext 6 37 0 00 56 | 1 92 92 55 Gosub 8 59 0 00 57 | 1 30 30 56 Goto 0 68 0 00 58 | 0 0 0 57 Integer 1 7 0 00 59 | 0 0 0 58 Return 8 0 0 00 60 | 36 2202 61 59 IfPos 6 61 0 00 61 | 1 274 274 60 Return 8 0 0 00 62 | 35 7970 227 61 AggFinal 3 1 0 sum(1) 00 63 | 35 11336 323 62 Copy 1 29 2 00 64 | 0 0 0 63 ResultRow 29 3 0 00 65 | 35 1104 31 64 Return 8 0 0 00 66 | 36 2762 76 65 Null 0 1 5 00 67 | 36 816 22 66 Integer 0 6 0 00 68 | 36 660 18 67 Return 9 0 0 00 69 | 0 0 0 68 Halt 0 0 0 00 70 | 1 37714 37714 69 Transaction 0 0 6 0 01 71 | 1 160 160 70 String 7 16 0 AMERICA 00 72 | 1 98 98 71 String 6 20 0 MFGR#1 00 73 | 1 46 46 72 String 6 21 0 MFGR#2 00 74 | 1 76 76 73 Goto 0 1 0 00 75 | -------------------------------------------------------------------------------- /analysis/data/ssb/profiles/vanilla/Q4.2.txt: -------------------------------------------------------------------------------- 1 | 1 340 340 0 Init 1 76 0 00 2 | 1 240 240 1 Noop 5 8 0 00 3 | 1 2002 2002 2 SorterOpen 6 5 0 k(3,B,B,B) 00 4 | 1 46 46 3 Integer 0 8 0 00 5 | 1 138 138 4 Null 0 11 13 00 6 | 1 58 58 5 Gosub 10 72 0 00 7 | 1 1118 1118 6 OpenRead 4 7 0 14 00 8 | 1 120 120 7 OpenRead 0 6 0 5 00 9 | 1 234 234 8 OpenRead 2 4 0 6 00 10 | 1 88 88 9 OpenRead 1 5 0 6 00 11 | 1 228 228 10 OpenRead 3 3 0 4 00 12 | 1 5388 5388 11 Rewind 4 40 0 00 13 | 29999810 4351282888 145 12 Column 4 5 17 00 14 | 29999810 4129148018 137 13 SeekRowid 0 39 17 00 15 | 29999810 1631056776 54 14 Column 0 4 18 00 16 | 29999810 639045166 21 15 Eq 19 18 18 BINARY-8 44 17 | 25451394 486198646 19 16 Column 0 4 18 00 18 | 25451394 468117222 18 17 Ne 20 39 18 BINARY-8 54 19 | 7217725 145500038 20 18 Column 4 4 21 00 20 | 7217725 3934276982 545 19 SeekRowid 2 39 21 00 21 | 7217725 575131822 79 20 Column 2 5 18 00 22 | 7217725 359922340 49 21 Ne 22 39 18 BINARY-8 52 23 | 1472812 44413754 30 22 Column 4 2 23 00 24 | 1472812 1405024824 953 23 SeekRowid 1 39 23 00 25 | 1472812 120815884 82 24 Column 1 5 18 00 26 | 1472812 71522854 48 25 Ne 22 39 18 BINARY-8 52 27 | 294368 7823334 26 26 Column 4 3 24 00 28 | 294368 655210848 2225 27 SeekRowid 3 39 24 00 29 | 294368 27738902 94 28 Column 3 2 18 00 30 | 294368 19258728 65 29 Eq 25 32 18 BINARY-8 42 31 | 235324 7673192 32 30 Column 3 2 18 00 32 | 235324 11063158 47 31 Ne 26 39 18 BINARY-8 52 33 | 117874 4632492 39 32 Column 0 4 27 00 34 | 117874 6762584 57 33 Column 2 4 28 00 35 | 117874 6058518 51 34 Column 3 3 29 00 36 | 117874 5918850 50 35 Column 4 12 30 00 37 | 117874 3738890 31 36 Column 4 13 31 00 38 | 117874 14645690 124 37 MakeRecord 27 5 18 00 39 | 117874 5938470 50 38 SorterInsert 6 18 0 00 40 | 29999810 676017088 22 39 Next 4 12 0 01 41 | 1 944 944 40 OpenPseudo 7 18 5 00 42 | 1 195846006 195846006 41 SorterSort 6 75 0 00 43 | 117874 2237006 18 42 SorterData 6 18 7 00 44 | 117874 4275574 36 43 Column 7 0 14 00 45 | 117874 4442318 37 44 Column 7 1 15 00 46 | 117874 4390480 37 45 Column 7 2 16 00 47 | 117874 8019230 68 46 Compare 11 14 3 k(3,B,B,B) 00 48 | 117874 2163468 18 47 Jump 48 52 48 00 49 | 100 7340 73 48 Move 14 11 3 00 50 | 100 2166 21 49 Gosub 9 66 0 00 51 | 100 1856 18 50 IfPos 8 75 0 00 52 | 100 3026 30 51 Gosub 10 72 0 00 53 | 117874 3940024 33 52 Column 7 3 33 00 54 | 117874 3714922 31 53 Column 7 4 34 00 55 | 117874 2213666 18 54 Subtract 34 33 32 00 56 | 117874 2587462 21 55 AggStep1 0 32 4 sum(1) 01 57 | 117874 2181130 18 56 If 7 60 0 00 58 | 100 1958 19 57 Column 7 0 1 00 59 | 100 2902 29 58 Column 7 1 2 00 60 | 100 2820 28 59 Column 7 2 3 00 61 | 117874 2162424 18 60 Integer 1 7 0 00 62 | 117874 2166692 18 61 SorterNext 6 42 0 00 63 | 1 34 34 62 Gosub 9 66 0 00 64 | 1 28 28 63 Goto 0 75 0 00 65 | 0 0 0 64 Integer 1 8 0 00 66 | 0 0 0 65 Return 9 0 0 00 67 | 101 2450 24 66 IfPos 7 68 0 00 68 | 1 254 254 67 Return 9 0 0 00 69 | 100 6962 69 68 AggFinal 4 1 0 sum(1) 00 70 | 100 16780 167 69 Copy 1 35 3 00 71 | 0 0 0 70 ResultRow 35 4 0 00 72 | 100 2304 23 71 Return 9 0 0 00 73 | 101 6256 61 72 Null 0 1 6 00 74 | 101 2092 20 73 Integer 0 7 0 00 75 | 101 1850 18 74 Return 10 0 0 00 76 | 0 0 0 75 Halt 0 0 0 00 77 | 1 38526 38526 76 Transaction 0 0 6 0 01 78 | 1 50 50 77 Integer 1997 19 0 00 79 | 1 38 38 78 Integer 1998 20 0 00 80 | 1 160 160 79 String 7 22 0 AMERICA 00 81 | 1 76 76 80 String 6 25 0 MFGR#1 00 82 | 1 46 46 81 String 6 26 0 MFGR#2 00 83 | 1 86 86 82 Goto 0 1 0 00 84 | -------------------------------------------------------------------------------- /analysis/data/ssb/profiles/vanilla/Q4.3.txt: -------------------------------------------------------------------------------- 1 | 1 240 240 0 Init 1 74 0 00 2 | 1 96 96 1 Noop 5 8 0 00 3 | 1 1582 1582 2 SorterOpen 6 5 0 k(3,B,B,B) 00 4 | 1 46 46 3 Integer 0 8 0 00 5 | 1 196 196 4 Null 0 11 13 00 6 | 1 78 78 5 Gosub 10 70 0 00 7 | 1 1558 1558 6 OpenRead 4 7 0 14 00 8 | 1 200 200 7 OpenRead 0 6 0 5 00 9 | 1 134 134 8 OpenRead 2 4 0 5 00 10 | 1 382 382 9 OpenRead 1 5 0 6 00 11 | 1 90 90 10 OpenRead 3 3 0 5 00 12 | 1 4610 4610 11 Rewind 4 38 0 00 13 | 29999810 4232442802 141 12 Column 4 5 17 00 14 | 29999810 4086291660 136 13 SeekRowid 0 37 17 00 15 | 29999810 1627875838 54 14 Column 0 4 18 00 16 | 29999810 637512526 21 15 Eq 19 18 18 BINARY-8 44 17 | 25451394 485414274 19 16 Column 0 4 18 00 18 | 25451394 468081784 18 17 Ne 20 37 18 BINARY-8 54 19 | 7217725 145427036 20 18 Column 4 4 21 00 20 | 7217725 3826123790 530 19 SeekRowid 2 37 21 00 21 | 7217725 579652496 80 20 Column 2 4 18 00 22 | 7217725 297559330 41 21 Ne 22 37 18 BINARY-8 52 23 | 284535 8343472 29 22 Column 4 2 23 00 24 | 284535 456508724 1604 23 SeekRowid 1 37 23 00 25 | 284535 28185080 99 24 Column 1 5 18 00 26 | 284535 15916604 55 25 Ne 24 37 18 BINARY-8 52 27 | 57068 1677700 29 26 Column 4 3 25 00 28 | 57068 146614866 2569 27 SeekRowid 3 37 25 00 29 | 57068 5688150 99 28 Column 3 3 18 00 30 | 57068 3661890 64 29 Ne 26 37 18 BINARY-8 52 31 | 2288 131538 57 30 Column 0 4 27 00 32 | 2288 111218 48 31 Column 2 3 28 00 33 | 2288 136198 59 32 Column 3 4 29 00 34 | 2288 144992 63 33 Column 4 12 30 00 35 | 2288 88854 38 34 Column 4 13 31 00 36 | 2288 480194 209 35 MakeRecord 27 5 18 00 37 | 2288 328178 143 36 SorterInsert 6 18 0 00 38 | 29999810 652190544 21 37 Next 4 12 0 01 39 | 1 950 950 38 OpenPseudo 7 18 5 00 40 | 1 2589662 2589662 39 SorterSort 6 73 0 00 41 | 2288 44542 19 40 SorterData 6 18 7 00 42 | 2288 84208 36 41 Column 7 0 14 00 43 | 2288 97916 42 42 Column 7 1 15 00 44 | 2288 113100 49 43 Column 7 2 16 00 45 | 2288 202218 88 44 Compare 11 14 3 k(3,B,B,B) 00 46 | 2288 42710 18 45 Jump 46 50 46 00 47 | 742 31266 42 46 Move 14 11 3 00 48 | 742 13930 18 47 Gosub 9 64 0 00 49 | 742 13616 18 48 IfPos 8 73 0 00 50 | 742 13866 18 49 Gosub 10 70 0 00 51 | 2288 96536 42 50 Column 7 3 33 00 52 | 2288 73594 32 51 Column 7 4 34 00 53 | 2288 43386 18 52 Subtract 34 33 32 00 54 | 2288 73354 32 53 AggStep1 0 32 4 sum(1) 01 55 | 2288 42580 18 54 If 7 58 0 00 56 | 742 13816 18 55 Column 7 0 1 00 57 | 742 16220 21 56 Column 7 1 2 00 58 | 742 18132 24 57 Column 7 2 3 00 59 | 2288 41914 18 58 Integer 1 7 0 00 60 | 2288 42322 18 59 SorterNext 6 40 0 00 61 | 1 36 36 60 Gosub 9 64 0 00 62 | 1 40 40 61 Goto 0 73 0 00 63 | 0 0 0 62 Integer 1 8 0 00 64 | 0 0 0 63 Return 9 0 0 00 65 | 743 14156 19 64 IfPos 7 66 0 00 66 | 1 104 104 65 Return 9 0 0 00 67 | 742 19896 26 66 AggFinal 4 1 0 sum(1) 00 68 | 742 80996 109 67 Copy 1 35 3 00 69 | 0 0 0 68 ResultRow 35 4 0 00 70 | 742 14344 19 69 Return 9 0 0 00 71 | 743 16894 22 70 Null 0 1 6 00 72 | 743 13790 18 71 Integer 0 7 0 00 73 | 743 13642 18 72 Return 10 0 0 00 74 | 0 0 0 73 Halt 0 0 0 00 75 | 1 38568 38568 74 Transaction 0 0 6 0 01 76 | 1 20 20 75 Integer 1997 19 0 00 77 | 1 38 38 76 Integer 1998 20 0 00 78 | 1 246 246 77 String 13 22 0 UNITED STATES 00 79 | 1 74 74 78 String 7 24 0 AMERICA 00 80 | 1 42 42 79 String 7 26 0 MFGR#14 00 81 | 1 40 40 80 Goto 0 1 0 00 82 | -------------------------------------------------------------------------------- /analysis/data/tatp/c220g5.csv: -------------------------------------------------------------------------------- 1 | system,records,trial,throughput 2 | sqlite_WAL,10 K,1,13504.5 3 | sqlite_WAL,10 K,2,13421.4 4 | sqlite_WAL,10 K,3,13414.2 5 | sqlite_WAL,100 K,1,12862.5 6 | sqlite_WAL,100 K,2,12752.3 7 | sqlite_WAL,100 K,3,12809.7 8 | sqlite_WAL,1 M,1,12230.8 9 | sqlite_WAL,1 M,2,12234.7 10 | sqlite_WAL,1 M,3,12253.2 11 | sqlite_DELETE,10 K,1,3793.38 12 | sqlite_DELETE,10 K,2,3903.27 13 | sqlite_DELETE,10 K,3,3830.17 14 | sqlite_DELETE,100 K,1,3845.32 15 | sqlite_DELETE,100 K,2,3846.68 16 | sqlite_DELETE,100 K,3,3894.58 17 | sqlite_DELETE,1 M,1,3109.77 18 | sqlite_DELETE,1 M,2,3120.93 19 | sqlite_DELETE,1 M,3,3481.45 20 | duckdb,10 K,1,1117.48 21 | duckdb,10 K,2,1113.67 22 | duckdb,10 K,3,1120.35 23 | duckdb,100 K,1,212 24 | duckdb,100 K,2,208.1 25 | duckdb,100 K,3,211.55 26 | duckdb,1 M,1,23.85 27 | duckdb,1 M,2,21.3833 28 | duckdb,1 M,3,23.4 29 | -------------------------------------------------------------------------------- /analysis/data/tatp/rpi.csv: -------------------------------------------------------------------------------- 1 | system,records,trial,throughput 2 | sqlite_WAL,10 K,1,670.7 3 | sqlite_WAL,10 K,2,686.5 4 | sqlite_WAL,10 K,3,671.433 5 | sqlite_WAL,100 K,1,675.3 6 | sqlite_WAL,100 K,2,642.8 7 | sqlite_WAL,100 K,3,574.683 8 | sqlite_WAL,1 M,1,572.283 9 | sqlite_WAL,1 M,2,638.867 10 | sqlite_WAL,1 M,3,523.033 11 | sqlite_DELETE,10 K,1,207.783 12 | sqlite_DELETE,10 K,2,173.3 13 | sqlite_DELETE,10 K,3,215.333 14 | sqlite_DELETE,100 K,1,196.483 15 | sqlite_DELETE,100 K,2,180.833 16 | sqlite_DELETE,100 K,3,155.667 17 | sqlite_DELETE,1 M,1,206.283 18 | sqlite_DELETE,1 M,2,168.15 19 | sqlite_DELETE,1 M,3,172.8 20 | duckdb,10 K,1,254.133 21 | duckdb,10 K,2,294.333 22 | duckdb,10 K,3,295.433 23 | duckdb,100 K,1,81.8333 24 | duckdb,100 K,2,81.05 25 | duckdb,100 K,3,81.6 26 | duckdb,1 M,1,10.95 27 | duckdb,1 M,2,10.5833 28 | duckdb,1 M,3,10.55 29 | -------------------------------------------------------------------------------- /analysis/logs/rpi/sqlite-performance_blob_log.txt: -------------------------------------------------------------------------------- 1 | *** Blob benchmark (scale factor 100000) *** 2 | Loading data into SQLite3... 3 | Evaluating SQLite3... 4 | ./blob_sqlite3 --run --size=100000 --mix=0.9 5 | 1,19934.2 6 | 2,19982.5 7 | 3,19878.7 8 | ./blob_sqlite3 --run --size=100000 --mix=0.5 9 | 1,16070.3 10 | 2,16049.3 11 | 3,16197.6 12 | ./blob_sqlite3 --run --size=100000 --mix=0.1 13 | 1,13547 14 | 2,13416.3 15 | 3,13466.3 16 | Loading data into DuckDB... 17 | Evaluating DuckDB... 18 | ./blob_duckdb --run --size=100000 --mix=0.9 19 | 1,490.15 20 | 2,664.75 21 | 3,583.75 22 | ./blob_duckdb --run --size=100000 --mix=0.5 23 | 1,142.683 24 | 2,133.117 25 | 3,132.75 26 | ./blob_duckdb --run --size=100000 --mix=0.1 27 | 1,71.8667 28 | 2,68.4667 29 | 3,78.3 30 | *** Blob benchmark (scale factor 1000000) *** 31 | Loading data into SQLite3... 32 | Evaluating SQLite3... 33 | ./blob_sqlite3 --run --size=1000000 --mix=0.9 34 | 1,1091.32 35 | 2,1146.12 36 | 3,1140.13 37 | ./blob_sqlite3 --run --size=1000000 --mix=0.5 38 | 1,1035.27 39 | 2,1044.78 40 | 3,1050.23 41 | ./blob_sqlite3 --run --size=1000000 --mix=0.1 42 | 1,886.467 43 | 2,910.667 44 | 3,877.817 45 | Loading data into DuckDB... 46 | Evaluating DuckDB... 47 | ./blob_duckdb --run --size=1000000 --mix=0.9 48 | 1,187.583 49 | 2,172.383 50 | 3,161.667 51 | ./blob_duckdb --run --size=1000000 --mix=0.5 52 | 1,34.7333 53 | 2,34.8 54 | 3,30.7333 55 | ./blob_duckdb --run --size=1000000 --mix=0.1 56 | 1,19.2167 57 | 2,19.0667 58 | 3,20.3833 59 | *** Blob benchmark (scale factor 10000000) *** 60 | Loading data into SQLite3... 61 | Evaluating SQLite3... 62 | ./blob_sqlite3 --run --size=10000000 --mix=0.9 63 | 1,122.367 64 | 2,124.567 65 | 3,120.233 66 | ./blob_sqlite3 --run --size=10000000 --mix=0.5 67 | 1,114.383 68 | 2,114.9 69 | 3,114.05 70 | ./blob_sqlite3 --run --size=10000000 --mix=0.1 71 | 1,109.6 72 | 2,109.3 73 | 3,109.367 74 | Loading data into DuckDB... 75 | Evaluating DuckDB... 76 | ./blob_duckdb --run --size=10000000 --mix=0.9 77 | 1,21.4 78 | 2,24.4167 79 | 3,21.4333 80 | ./blob_duckdb --run --size=10000000 --mix=0.5 81 | 1,4.45 82 | 2,4.4 83 | 3,4.68333 84 | ./blob_duckdb --run --size=10000000 --mix=0.1 85 | 1,2.53333 86 | 2,2.56667 87 | 3,2.51667 88 | -------------------------------------------------------------------------------- /analysis/logs/rpi/sqlite-performance_ssb-rerun_log.txt: -------------------------------------------------------------------------------- 1 | *** SSB (scale factor 1) *** 2 | Generating data... 3 | SSB (Star Schema Benchmark) Population Generator (Version 1.0.0) 4 | Copyright Transaction Processing Performance Council 1994 - 2000 5 | Loading data into SQLite3... 6 | Evaluating SQLite3... 7 | ./ssb_sqlite3 --bloom_filter=false --cache_size=-100000 8 | trial,Q1.1,Q1.2,Q1.3,Q2.1,Q2.2,Q2.3,Q3.1,Q3.2,Q3.3,Q3.4,Q4.1,Q4.2,Q4.3 9 | 1,2.51149,2.18075,2.07161,15.1815,14.6202,14.2482,6.9261,4.85393,4.84702,4.96579,7.13399,4.88043,4.70447 10 | 2,2.4884,2.24194,2.11647,15.1985,14.8233,14.2662,6.79763,4.86431,4.97057,4.90436,7.12731,4.92728,4.65938 11 | 3,2.45875,2.18387,2.07692,15.0876,14.8355,14.1179,6.89341,4.84862,4.79906,5.00886,7.11887,4.84835,4.73065 12 | ./ssb_sqlite3 --bloom_filter=false --cache_size=-200000 13 | trial,Q1.1,Q1.2,Q1.3,Q2.1,Q2.2,Q2.3,Q3.1,Q3.2,Q3.3,Q3.4,Q4.1,Q4.2,Q4.3 14 | 1,2.46782,2.20987,2.10213,14.8742,14.8942,14.2747,6.77608,4.82235,4.8891,4.81664,7.04455,4.82718,4.5441 15 | 2,2.45071,2.16819,2.06678,14.8263,14.7218,14.228,6.82655,4.83281,4.85034,5.01792,7.08009,4.74942,4.6005 16 | 3,2.44595,2.2194,2.10775,14.9404,14.8338,14.2649,6.85294,4.80602,4.97885,4.89595,7.06476,4.83706,4.59189 17 | ./ssb_sqlite3 --bloom_filter=false --cache_size=-500000 18 | trial,Q1.1,Q1.2,Q1.3,Q2.1,Q2.2,Q2.3,Q3.1,Q3.2,Q3.3,Q3.4,Q4.1,Q4.2,Q4.3 19 | 1,1.77977,1.45901,1.30389,15.1034,14.5644,14.103,5.72691,3.89436,3.9873,3.89453,6.03252,4.00834,3.79386 20 | 2,1.80796,1.48858,1.34048,15.2474,14.4209,13.9637,5.72086,3.79257,3.89762,3.85749,5.90428,3.99668,3.81294 21 | 3,1.76842,1.4623,1.32486,15.06,14.4291,14.0298,5.78213,3.74454,3.90733,3.8928,6.02799,3.99827,3.77797 22 | ./ssb_sqlite3 --bloom_filter=false --cache_size=-1000000 23 | trial,Q1.1,Q1.2,Q1.3,Q2.1,Q2.2,Q2.3,Q3.1,Q3.2,Q3.3,Q3.4,Q4.1,Q4.2,Q4.3 24 | 1,1.79629,1.46845,1.36325,13.6283,13.2204,12.7158,5.76181,3.88129,3.84733,3.82688,5.94409,3.95451,3.80897 25 | 2,1.75057,1.44162,1.30107,13.8074,13.2084,12.7703,5.73062,3.94048,3.97438,3.94603,5.89031,3.98837,3.82657 26 | 3,1.80694,1.48157,1.34178,13.8744,13.3238,12.8145,5.89764,3.71868,3.88979,4.04134,6.01155,3.91646,3.9681 27 | ./ssb_sqlite3 --bloom_filter=false --cache_size=-2000000 28 | trial,Q1.1,Q1.2,Q1.3,Q2.1,Q2.2,Q2.3,Q3.1,Q3.2,Q3.3,Q3.4,Q4.1,Q4.2,Q4.3 29 | 1,1.7445,1.47881,1.32277,13.782,13.2796,13.0308,5.84017,3.83793,3.90084,3.91515,6.06751,4.06069,3.83152 30 | 2,1.75943,1.44939,1.31062,13.5858,13.0976,12.8132,5.66367,3.77224,3.91918,3.87474,5.80403,3.95096,3.8062 31 | 3,1.77082,1.46786,1.31255,13.6557,12.9746,12.5826,5.70043,3.73441,3.7758,3.83816,5.91486,3.8961,3.71377 32 | ./ssb_sqlite3 --bloom_filter=false --cache_size=-5000000 33 | trial,Q1.1,Q1.2,Q1.3,Q2.1,Q2.2,Q2.3,Q3.1,Q3.2,Q3.3,Q3.4,Q4.1,Q4.2,Q4.3 34 | 1,1.74307,1.44104,1.29881,13.6849,13.2289,12.7967,5.62003,3.78996,3.88691,3.80024,5.77837,3.96617,3.80306 35 | 2,1.7714,1.4533,1.30693,13.6118,12.9964,12.6028,5.71188,3.70869,3.78547,3.86928,5.81596,3.87229,3.72434 36 | 3,1.74372,1.43473,1.31271,13.6257,13.0967,12.766,5.65357,3.79873,3.85408,3.75288,5.92006,3.97501,3.69628 37 | ./ssb_sqlite3 --bloom_filter=true --cache_size=-100000 38 | trial,Q1.1,Q1.2,Q1.3,Q2.1,Q2.2,Q2.3,Q3.1,Q3.2,Q3.3,Q3.4,Q4.1,Q4.2,Q4.3 39 | 1,2.50193,2.02623,1.92236,2.20181,1.89923,1.80365,3.55619,1.76429,1.66528,1.63493,2.81544,2.59087,2.18477 40 | 2,2.47958,2.0061,1.97199,2.25863,1.92549,1.80989,3.52111,1.8154,1.66444,1.68513,2.88415,2.62156,2.17339 41 | 3,2.54884,2.02341,1.9769,2.20422,1.85833,1.7814,3.58928,1.77235,1.69414,1.66471,2.81608,2.57866,2.16827 42 | ./ssb_sqlite3 --bloom_filter=true --cache_size=-200000 43 | trial,Q1.1,Q1.2,Q1.3,Q2.1,Q2.2,Q2.3,Q3.1,Q3.2,Q3.3,Q3.4,Q4.1,Q4.2,Q4.3 44 | 1,2.48548,2.00666,1.96816,2.22196,1.88977,1.80771,3.51234,1.72797,1.63903,1.64305,2.84221,2.55395,2.14818 45 | 2,2.50531,1.99024,1.96149,2.20031,1.88356,1.76226,3.50951,1.76972,1.67057,1.66593,2.82873,2.5214,2.14064 46 | 3,2.50303,2.09166,1.97579,2.23336,1.92404,1.82067,3.55689,1.73363,1.64047,1.64883,2.84329,2.58009,2.1681 47 | ./ssb_sqlite3 --bloom_filter=true --cache_size=-500000 48 | trial,Q1.1,Q1.2,Q1.3,Q2.1,Q2.2,Q2.3,Q3.1,Q3.2,Q3.3,Q3.4,Q4.1,Q4.2,Q4.3 49 | 1,1.83715,1.25576,1.17824,1.39216,1.11289,0.997933,2.65476,0.973811,0.871523,0.864866,1.9549,1.73244,1.35667 50 | 2,1.79416,1.21124,1.17162,1.38379,1.09365,0.99032,2.67871,0.968975,0.868771,0.853136,1.94424,1.70182,1.34012 51 | 3,1.7971,1.20962,1.15542,1.34752,1.08404,0.97632,2.67801,0.969709,0.876806,0.871166,1.9751,1.72324,1.33839 52 | ./ssb_sqlite3 --bloom_filter=true --cache_size=-1000000 53 | trial,Q1.1,Q1.2,Q1.3,Q2.1,Q2.2,Q2.3,Q3.1,Q3.2,Q3.3,Q3.4,Q4.1,Q4.2,Q4.3 54 | 1,1.8521,1.23633,1.15722,1.32211,1.05769,0.960669,2.67957,0.987653,0.909536,0.922483,1.97581,1.7018,1.36445 55 | 2,1.85569,1.23532,1.17839,1.35851,1.07238,0.973173,2.62111,0.943934,0.864083,0.859,1.95011,1.71607,1.34418 56 | 3,1.79394,1.22299,1.17541,1.37984,1.10504,0.992308,2.63968,0.948739,0.862895,0.853135,1.89917,1.68819,1.34233 57 | ./ssb_sqlite3 --bloom_filter=true --cache_size=-2000000 58 | trial,Q1.1,Q1.2,Q1.3,Q2.1,Q2.2,Q2.3,Q3.1,Q3.2,Q3.3,Q3.4,Q4.1,Q4.2,Q4.3 59 | 1,1.78121,1.20911,1.15657,1.37064,1.08257,0.982295,2.67507,0.957658,0.864141,0.858645,1.90602,1.67581,1.32375 60 | 2,1.81035,1.20969,1.16052,1.32501,1.07172,0.973043,2.64074,0.968048,0.866713,0.877161,1.93875,1.70943,1.34098 61 | 3,1.8296,1.2322,1.18805,1.36327,1.07654,0.980422,2.62625,0.976902,0.882613,0.872171,1.97429,1.70476,1.34282 62 | ./ssb_sqlite3 --bloom_filter=true --cache_size=-5000000 63 | trial,Q1.1,Q1.2,Q1.3,Q2.1,Q2.2,Q2.3,Q3.1,Q3.2,Q3.3,Q3.4,Q4.1,Q4.2,Q4.3 64 | 1,1.85095,1.24466,1.18506,1.38828,1.10527,0.999283,2.607,0.954126,0.86164,0.856296,1.95194,1.75563,1.36158 65 | 2,1.8613,1.36906,1.20123,1.42522,1.12772,1.02299,2.78041,0.956539,0.870362,0.858471,1.91013,1.70804,1.39406 66 | 3,1.78919,1.20513,1.15902,1.36849,1.09293,0.996822,2.70789,0.973901,0.872998,0.877407,1.9119,1.68538,1.34062 67 | -------------------------------------------------------------------------------- /analysis/plots/blob_100_KB_c220g5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UWHustle/sqlite-past-present-future/b0fa203c79b75b3db01dd05f01de676c5f5e7bbf/analysis/plots/blob_100_KB_c220g5.pdf -------------------------------------------------------------------------------- /analysis/plots/blob_100_KB_rpi.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UWHustle/sqlite-past-present-future/b0fa203c79b75b3db01dd05f01de676c5f5e7bbf/analysis/plots/blob_100_KB_rpi.pdf -------------------------------------------------------------------------------- /analysis/plots/blob_10_MB_c220g5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UWHustle/sqlite-past-present-future/b0fa203c79b75b3db01dd05f01de676c5f5e7bbf/analysis/plots/blob_10_MB_c220g5.pdf -------------------------------------------------------------------------------- /analysis/plots/blob_10_MB_rpi.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UWHustle/sqlite-past-present-future/b0fa203c79b75b3db01dd05f01de676c5f5e7bbf/analysis/plots/blob_10_MB_rpi.pdf -------------------------------------------------------------------------------- /analysis/plots/profile_bloom.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UWHustle/sqlite-past-present-future/b0fa203c79b75b3db01dd05f01de676c5f5e7bbf/analysis/plots/profile_bloom.pdf -------------------------------------------------------------------------------- /analysis/plots/profile_vanilla.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UWHustle/sqlite-past-present-future/b0fa203c79b75b3db01dd05f01de676c5f5e7bbf/analysis/plots/profile_vanilla.pdf -------------------------------------------------------------------------------- /analysis/plots/ssb_bloom_c220g5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UWHustle/sqlite-past-present-future/b0fa203c79b75b3db01dd05f01de676c5f5e7bbf/analysis/plots/ssb_bloom_c220g5.pdf -------------------------------------------------------------------------------- /analysis/plots/ssb_bloom_rpi.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UWHustle/sqlite-past-present-future/b0fa203c79b75b3db01dd05f01de676c5f5e7bbf/analysis/plots/ssb_bloom_rpi.pdf -------------------------------------------------------------------------------- /analysis/plots/ssb_c220g5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UWHustle/sqlite-past-present-future/b0fa203c79b75b3db01dd05f01de676c5f5e7bbf/analysis/plots/ssb_c220g5.pdf -------------------------------------------------------------------------------- /analysis/plots/ssb_rpi.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UWHustle/sqlite-past-present-future/b0fa203c79b75b3db01dd05f01de676c5f5e7bbf/analysis/plots/ssb_rpi.pdf -------------------------------------------------------------------------------- /analysis/plots/tatp_c220g5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UWHustle/sqlite-past-present-future/b0fa203c79b75b3db01dd05f01de676c5f5e7bbf/analysis/plots/tatp_c220g5.pdf -------------------------------------------------------------------------------- /analysis/plots/tatp_rpi.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UWHustle/sqlite-past-present-future/b0fa203c79b75b3db01dd05f01de676c5f5e7bbf/analysis/plots/tatp_rpi.pdf -------------------------------------------------------------------------------- /analysis/profile.py: -------------------------------------------------------------------------------- 1 | from collections import defaultdict 2 | import pandas as pd 3 | import matplotlib as mpl 4 | import matplotlib.pyplot as plt 5 | import seaborn as sns 6 | 7 | from util import queries 8 | 9 | mpl.rc('pdf', fonttype=42) 10 | sns.set() 11 | 12 | for config in ['vanilla', 'bloom']: 13 | if config == 'vanilla': 14 | palette = sns.color_palette('colorblind') 15 | del palette[6] 16 | sns.set_palette(palette) 17 | else: 18 | sns.set_palette('colorblind') 19 | 20 | data = {} 21 | for query in queries: 22 | profile = defaultdict(int) 23 | with open(f'data/ssb/profiles/{config}/{query}.txt', 'r') as f: 24 | for line in f: 25 | tokens = line.split() 26 | profile[tokens[4]] += int(tokens[1]) 27 | 28 | data[query] = dict(profile) 29 | 30 | opcodes = ['SeekRowid', 'Column', 'SorterSort', 'Ne', 'Eq', 'Next'] \ 31 | if config == 'vanilla' \ 32 | else ['SeekRowid', 'Column', 'SorterSort', 'Ne', 'Eq', 'Next', 'Filter'] 33 | 34 | df = pd.DataFrame.from_dict(data, orient='index') 35 | 36 | print(df.reindex(df.max().sort_values().index, axis=1).columns) 37 | 38 | df['Other'] = df[df.columns.difference(opcodes)].sum(axis=1) 39 | df = df[opcodes + ['Other']] 40 | 41 | ax = df.plot( 42 | kind='bar', 43 | stacked=True, 44 | ylim=(0, 6e10) if config == 'vanilla' else (0, 2e10), 45 | yticks=[0, 1e10, 2e10, 3e10, 4e10] if config == 'vanilla' else [0, 1e10], 46 | rot=0, 47 | width=0.6, 48 | figsize=(5.8, 3) 49 | ) 50 | 51 | plt.grid(False, axis='x') 52 | plt.xlabel('Query') 53 | plt.ylabel('CPU cycles') 54 | plt.legend(ncol=4, loc='upper center') 55 | plt.subplots_adjust(left=0.08, right=0.99, top=0.92, bottom=0.19) 56 | plt.savefig(f'plots/profile_{config}.pdf') 57 | -------------------------------------------------------------------------------- /analysis/ssb.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | import matplotlib as mpl 3 | import matplotlib.pyplot as plt 4 | import seaborn as sns 5 | 6 | from util import hardware, queries 7 | 8 | mpl.rc('pdf', fonttype=42) 9 | sns.set() 10 | 11 | 12 | def plot(bloom=True): 13 | palette = sns.color_palette('colorblind') 14 | if bloom: 15 | palette[1], palette[2] = palette[2], palette[1] 16 | sns.set_palette(palette) 17 | 18 | for hw in hardware: 19 | sf = 1 if hw == 'rpi' else 5 20 | df = pd.read_csv(f'data/ssb/{hw}.csv') 21 | df = df[(df.cache_size == '1 GB') & (df['scale'] == sf)] 22 | df = df[~((df.system == 'duckdb') & (df.threads == 2))] 23 | df.loc[(df.system == 'duckdb') & (df['threads'] == 4), 'system'] = 'duckdb_mt' 24 | df.loc[(df.system == 'sqlite') & df['bloom_filter'], 'system'] = 'sqlite_bloom' 25 | 26 | df = df[~(df.system == 'duckdb_mt')] 27 | 28 | for q in queries: 29 | df[q] *= 1000 30 | 31 | if not bloom: 32 | df = df[~(df.system == 'sqlite_bloom')] 33 | 34 | df = (df.groupby('system', sort=False)[queries] 35 | .agg(['mean', 'min', 'max']) 36 | .stack() 37 | .transpose() 38 | .swaplevel(0, 1, 1) 39 | .rename_axis('query') 40 | .reset_index()) 41 | 42 | if bloom: 43 | print(df['mean', 'sqlite'].sum(), df['mean', 'sqlite_bloom'].sum(), df['mean', 'duckdb'].sum()) 44 | 45 | err_lo = df['mean'] - df['min'] 46 | err_hi = df['max'] - df['mean'] 47 | 48 | system_list = ['sqlite', 'sqlite_bloom', 'duckdb'] if bloom else ['sqlite', 'duckdb'] 49 | 50 | ax = df.plot( 51 | kind='bar', 52 | x='query', 53 | y='mean', 54 | # yerr=[[err_lo[s], err_hi[s]] for s in system_list], 55 | logy=True, 56 | yticks=[1e2, 1e3, 1e4], 57 | ylim=(6e1, 1.6e5), 58 | rot=0, 59 | width=0.85 if bloom else 0.75, 60 | figsize=(12.3, 2.5) 61 | ) 62 | 63 | for patch in ax.patches: 64 | ax.annotate( 65 | '{:.0e}'.format(patch.get_height()).replace('+0', ''), 66 | (patch.get_x() + 0.5 * patch.get_width(), 1.85 * patch.get_height()), 67 | alpha=0.8, 68 | size='small', 69 | ha='center', 70 | va='top' 71 | ) 72 | 73 | plt.grid(False, axis='x') 74 | plt.xlabel('Query') 75 | plt.ylabel('Latency (ms)') 76 | plt.legend( 77 | labels=['SQLite', 'SQLite-LIP', 'DuckDB'] if bloom else ['SQLite', 'DuckDB'], 78 | ncol=3, 79 | loc='upper center' 80 | ) 81 | plt.subplots_adjust(left=0.06, right=0.99, top=0.96, bottom=0.20) 82 | plt.savefig(f'plots/ssb_bloom_{hw}.pdf' if bloom else f'plots/ssb_{hw}.pdf') 83 | 84 | 85 | plot(False) 86 | plot(True) 87 | -------------------------------------------------------------------------------- /analysis/tatp.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | import matplotlib as mpl 3 | import matplotlib.pyplot as plt 4 | import seaborn as sns 5 | 6 | from util import hardware 7 | 8 | mpl.rc('pdf', fonttype=42) 9 | sns.set() 10 | 11 | palette = sns.color_palette('colorblind') 12 | palette[1], palette[2] = palette[2], palette[1] 13 | sns.set_palette(palette) 14 | 15 | for hw in hardware: 16 | df = pd.read_csv(f'data/tatp/{hw}.csv') 17 | df = (df 18 | .groupby(['records', 'system'], sort=False)[['throughput']] 19 | .agg(['mean', 'min', 'max']) 20 | .unstack() 21 | .droplevel(0, axis=1) 22 | .reset_index()) 23 | 24 | err_lo = df['mean'] - df['min'] 25 | err_hi = df['max'] - df['mean'] 26 | 27 | ax = df.plot.bar( 28 | x='records', 29 | y='mean', 30 | # yerr=[[err_lo[s], err_hi[s]] for s in ['sqlite_WAL', 'sqlite_DELETE', 'duckdb']], 31 | logy=True, 32 | ylim=(2, 5e5), 33 | yticks=[1e1, 1e2, 1e3, 1e4], 34 | rot=0, 35 | width=0.63, 36 | figsize=(5.8, 2.5) 37 | ) 38 | 39 | for patch in ax.patches: 40 | ax.annotate( 41 | '{:.0e}'.format(patch.get_height()).replace('+0', ''), 42 | (patch.get_x() + 0.5 * patch.get_width(), 2.8 * patch.get_height()), 43 | # color='white', 44 | alpha=0.8, 45 | size='small', 46 | ha='center', 47 | va='top' 48 | ) 49 | 50 | plt.grid(False, axis='x') 51 | plt.xlabel('Subscriber Records') 52 | plt.ylabel('Throughput (TPS)') 53 | plt.legend(labels=['SQLite-WAL', 'SQLite-DELETE', 'DuckDB'], ncol=3, loc='upper center') 54 | plt.subplots_adjust(left=0.12, right=0.99, top=0.90, bottom=0.20) 55 | plt.savefig(f'plots/tatp_{hw}.pdf') 56 | -------------------------------------------------------------------------------- /analysis/util.py: -------------------------------------------------------------------------------- 1 | hardware = ['c220g5', 'rpi'] 2 | systems = {'sqlite': 'SQLite', 'duckdb': 'DuckDB'} 3 | queries = ['Q1.1', 'Q1.2', 'Q1.3', 'Q2.1', 'Q2.2', 'Q2.3', 'Q3.1', 'Q3.2', 'Q3.3', 'Q3.4', 'Q4.1', 'Q4.2', 'Q4.3'] 4 | -------------------------------------------------------------------------------- /scripts/all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ( 4 | cd ssb || exit 5 | ./ssb.sh 6 | ) 7 | 8 | ( 9 | cd tatp || exit 10 | ./tatp.sh 11 | ) 12 | 13 | ( 14 | cd blob || exit 15 | ./blob.sh 16 | ) 17 | -------------------------------------------------------------------------------- /scripts/benchmarks/blob.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | for sf in 100000 1000000 10000000; do 4 | printf "*** Blob benchmark (scale factor %s) ***\n" "$sf" 5 | 6 | printf "Loading data into SQLite3...\n" 7 | ./blob_sqlite3 --load --size=$sf 8 | 9 | printf "Evaluating SQLite3...\n" 10 | for mix in "0.9" "0.5" "0.1"; do 11 | command="./blob_sqlite3 --run --size=$sf --mix=$mix" 12 | printf "%s\n" "$command" 13 | for trial in {1..3}; do 14 | printf "%s," "$trial" 15 | eval "$command" 16 | done 17 | done 18 | 19 | rm blob.sqlite 20 | 21 | printf "Loading data into DuckDB...\n" 22 | ./blob_duckdb --load --size=$sf 23 | 24 | printf "Evaluating DuckDB...\n" 25 | for mix in "0.9" "0.5" "0.1"; do 26 | command="./blob_duckdb --run --size=$sf --mix=$mix" 27 | printf "%s\n" "$command" 28 | for trial in {1..3}; do 29 | printf "%s," "$trial" 30 | eval "$command" 31 | done 32 | done 33 | 34 | rm blob.duckdb 35 | done 36 | -------------------------------------------------------------------------------- /scripts/benchmarks/ssb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | for sf in 1 2 5; do 4 | printf "*** SSB (scale factor %s) ***\n" "$sf" 5 | 6 | printf "Generating data...\n" 7 | rm -f ./*.tbl 8 | ./dbgen -s "$sf" 9 | 10 | printf "Loading data into SQLite3...\n" 11 | ../sqlite3_shell ssb.sqlite 7 | #include 8 | #include 9 | #include 10 | 11 | void assert_success(const std::unique_ptr &result) { 12 | if (!result->success) { 13 | throw std::runtime_error(result->error); 14 | } 15 | } 16 | 17 | class Worker { 18 | public: 19 | Worker(duckdb::Connection conn, size_t size, float mix) 20 | : conn_(std::move(conn)), size_(size), 21 | select_stmt_(conn_.Prepare("SELECT a FROM t")), 22 | update_stmt_(conn_.Prepare("UPDATE t SET a = ?")), blob_(malloc(size)), 23 | dis_({mix, 1.0 - mix}), gen_(std::random_device()()) {} 24 | 25 | bool operator()() { 26 | int type = dis_(gen_); 27 | 28 | if (type == 0) { 29 | assert_success(select_stmt_->Execute()); 30 | } else { 31 | assert_success(update_stmt_->Execute( 32 | duckdb::Value::BLOB((const unsigned char *)blob_, size_))); 33 | } 34 | 35 | return true; 36 | } 37 | 38 | private: 39 | duckdb::Connection conn_; 40 | std::unique_ptr select_stmt_; 41 | std::unique_ptr update_stmt_; 42 | size_t size_; 43 | void *blob_; 44 | std::discrete_distribution dis_; 45 | std::minstd_rand gen_; 46 | }; 47 | 48 | int main(int argc, char **argv) { 49 | cxxopts::Options options = 50 | blob_options("blob_duckdb", "Blob benchmark on DuckDB"); 51 | 52 | auto result = options.parse(argc, argv); 53 | 54 | if (result.count("help")) { 55 | std::cout << options.help(); 56 | return 0; 57 | } 58 | 59 | auto size = result["size"].as(); 60 | auto mix = result["mix"].as(); 61 | 62 | duckdb::DuckDB db("blob.duckdb"); 63 | 64 | if (result.count("load")) { 65 | duckdb::Connection conn(db); 66 | 67 | assert_success(conn.Query("DROP TABLE IF EXISTS t")); 68 | assert_success(conn.Query("CREATE TABLE t (a BLOB)")); 69 | 70 | void *blob = malloc(size); 71 | 72 | assert_success( 73 | conn.Query("INSERT INTO t VALUES (?)", 74 | duckdb::Value::BLOB((const unsigned char *)blob, size))); 75 | 76 | free(blob); 77 | } 78 | 79 | if (result.count("run")) { 80 | duckdb::Connection conn(db); 81 | assert_success(conn.Query("PRAGMA memory_limit='1GB'")); 82 | std::vector workers; 83 | workers.emplace_back(conn, size, mix); 84 | 85 | double throughput = dbbench::run(workers, result["warmup"].as(), 86 | result["measure"].as()); 87 | 88 | std::cout << throughput << std::endl; 89 | } 90 | 91 | return 0; 92 | } 93 | -------------------------------------------------------------------------------- /src/benchmarks/blob/blob_sqlite3.cpp: -------------------------------------------------------------------------------- 1 | #include "cxxopts.hpp" 2 | #include "dbbench/runner.hpp" 3 | #include "helpers.hpp" 4 | #include "sqlite3.hpp" 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | class Worker { 12 | public: 13 | Worker(sqlite::Connection conn, size_t size, float mix) 14 | : conn_(std::move(conn)), size_(size), blob_(malloc(size)), 15 | dis_({mix, 1.0 - mix}), gen_(std::random_device()()) { 16 | conn_.prepare(select_stmt_, "SELECT a FROM t").expect(SQLITE_OK); 17 | conn_.prepare(update_stmt_, "UPDATE t SET a = ?").expect(SQLITE_OK); 18 | } 19 | 20 | ~Worker() { free(blob_); } 21 | 22 | bool operator()() { 23 | int type = dis_(gen_); 24 | 25 | if (type == 0) { 26 | select_stmt_.execute().expect(SQLITE_OK); 27 | } else { 28 | update_stmt_.bind_blob(1, blob_, (int)size_).expect(SQLITE_OK); 29 | update_stmt_.execute().expect(SQLITE_OK); 30 | } 31 | 32 | return true; 33 | } 34 | 35 | private: 36 | sqlite::Connection conn_; 37 | sqlite::Statement select_stmt_; 38 | sqlite::Statement update_stmt_; 39 | size_t size_; 40 | void *blob_; 41 | std::discrete_distribution dis_; 42 | std::minstd_rand gen_; 43 | }; 44 | 45 | int main(int argc, char **argv) { 46 | cxxopts::Options options = 47 | blob_options("blob_sqlite3", "Blob benchmark on SQLite3"); 48 | 49 | auto result = options.parse(argc, argv); 50 | 51 | if (result.count("help")) { 52 | std::cout << options.help(); 53 | return 0; 54 | } 55 | 56 | auto size = result["size"].as(); 57 | auto mix = result["mix"].as(); 58 | 59 | sqlite::Database db("blob.sqlite"); 60 | 61 | if (result.count("load")) { 62 | sqlite::Connection conn; 63 | db.connect(conn).expect(SQLITE_OK); 64 | 65 | conn.execute("DROP TABLE IF EXISTS t").expect(SQLITE_OK); 66 | conn.execute("CREATE TABLE t (a BLOB)").expect(SQLITE_OK); 67 | 68 | void *blob = malloc(size); 69 | 70 | sqlite::Statement insert_stmt; 71 | conn.prepare(insert_stmt, "INSERT INTO t VALUES (?)").expect(SQLITE_OK); 72 | insert_stmt.bind_blob(1, blob, (int)size).expect(SQLITE_OK); 73 | insert_stmt.execute().expect(SQLITE_OK); 74 | 75 | free(blob); 76 | } 77 | 78 | if (result.count("run")) { 79 | sqlite::Connection conn; 80 | db.connect(conn).expect(SQLITE_OK); 81 | conn.execute("PRAGMA cache_size=-1000000").expect(SQLITE_OK); 82 | std::vector workers; 83 | workers.emplace_back(conn, size, mix); 84 | 85 | double throughput = dbbench::run(workers, result["warmup"].as(), 86 | result["measure"].as()); 87 | 88 | std::cout << throughput << std::endl; 89 | } 90 | 91 | return 0; 92 | } 93 | -------------------------------------------------------------------------------- /src/benchmarks/blob/helpers.hpp: -------------------------------------------------------------------------------- 1 | #ifndef SQLITE_PERFORMANCE_BLOB_HELPERS_HPP 2 | #define SQLITE_PERFORMANCE_BLOB_HELPERS_HPP 3 | 4 | cxxopts::Options blob_options(const std::string &program, 5 | const std::string &help_string = "") { 6 | cxxopts::Options options(program, help_string); 7 | cxxopts::OptionAdder adder = options.add_options(); 8 | adder("load", "Load the database"); 9 | adder("run", "Run the benchmark"); 10 | adder("size", "Size of the blob in bytes", 11 | cxxopts::value()->default_value("1000")); 12 | adder("mix", "Read transaction fraction", 13 | cxxopts::value()->default_value("0.5")); 14 | adder("warmup", "Warmup duration in seconds", 15 | cxxopts::value()->default_value("10")); 16 | adder("measure", "Measure duration in seconds", 17 | cxxopts::value()->default_value("60")); 18 | adder("help", "Print help"); 19 | return options; 20 | } 21 | 22 | #endif // SQLITE_PERFORMANCE_BLOB_HELPERS_HPP 23 | -------------------------------------------------------------------------------- /src/benchmarks/ssb/dbgen/.gitignore: -------------------------------------------------------------------------------- 1 | config.h 2 | -------------------------------------------------------------------------------- /src/benchmarks/ssb/dbgen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(CheckIncludeFiles) 2 | include(CheckTypeSize) 3 | include(CheckSymbolExists) 4 | include(CheckFunctionExists) 5 | 6 | set(DATABASE "DB2" CACHE STRING "Command language dialect to target with the qgen query generator (\"DATABASE\"") 7 | set_property(CACHE DATABASE PROPERTY STRINGS INFORMIX DB2 TDAT SQLSERVER SYBASE) 8 | 9 | set(WORKLOAD SSB CACHE STRING "Choice of benchmark / query workload (\"WORKLOAD\")") 10 | set_property(CACHE WORKLOAD PROPERTY STRINGS TPCH SSB) 11 | 12 | set(CSV_OUTPUT_FORMAT OFF CACHE BOOL "Use CSV output format") 13 | set(EOL_HANDLING ON CACHE BOOL "Skip separator after the last field in generated lines?") 14 | set(YMD_DASH_DATE OFF CACHE BOOL "Generate date values in YYYY-MM-DD format (with dashes) rather than YYYYMMDD") 15 | 16 | if (CSV_OUTPUT_FORMAT AND NOT EOL_HANDLING) 17 | message(WARNING "When CSV is used for the output format, EOL_HANDLING is ignored and a separator is _never_ printed after the last field on the line (the equivalent of EOL_HANDLING being ON).") 18 | endif () 19 | 20 | check_type_size("long long" SIZEOF_LONG_LONG) 21 | check_type_size("long" SIZEOF_LONG) 22 | check_type_size("int" SIZEOF_INT) 23 | check_type_size("short" SIZEOF_SHORT) 24 | 25 | # Header checks... 26 | 27 | # ... for POSIX systems 28 | check_include_file(unistd.h HAVE_UNISTD_H) 29 | check_include_file(fcntl.h HAVE_FCNTL_H) 30 | check_include_file(sys/wait.h HAVE_SYS_WAIT_H) 31 | check_include_file(sys/types.h HAVE_SYS_TYPES_H) 32 | check_include_file(sys/stat.h HAVE_SYS_STAT_H) 33 | check_include_file(strings.h HAVE_STRINGS_H) 34 | check_include_file(inttypes.h HAVE_INTTYPES_H) 35 | 36 | # ... for Windows 37 | check_include_file(getopt.h HAVE_GETOPT_H) 38 | check_include_file(process.h HAVE_PROCESS_H) 39 | check_include_file(windows.h HAVE_WINDOWS_H) 40 | 41 | # ... non-platform-specific 42 | check_include_file(stdint.h HAVE_STDINT_H) # standard since C99 43 | check_include_file(sys/bittypes.h HAVE_SYS_BITTYPES_H) 44 | 45 | check_symbol_exists(malloc stdlib.h HAVE_MALLOC_IN_STDLIB) 46 | if (NOT HAVE_MALLOC_IN_STDLIB) 47 | check_include_file(malloc.h HAVE_MALLOC_H) 48 | if (NOT HAVE_MALLOC_H) 49 | message(FATAL_ERROR "Could not locate a definition of the malloc() function") 50 | endif () 51 | endif () 52 | 53 | if (NOT HAVE_UNISTD_H AND HAVE_SYS_TYPES_H) 54 | check_symbol_exists(pid_t sys/types.h HAVE_PID_T_IN_SYS_TYPES_H) 55 | endif () 56 | 57 | check_symbol_exists(getopt stdlib.h STDLIB_HAS_GETOPT) 58 | check_symbol_exists(getenv stdlib.h STDLIB_HAS_GETENV) 59 | if (NOT STDLIB_HAS_GETENV) 60 | message(FATAL_ERROR "getenv is required but not found") 61 | endif () 62 | #check_function_exists(getpid HAVE_GETPID) 63 | #if (NOT HAVE_GETPID) 64 | # check_function_exists(_getpid HAVE__GETPID) 65 | #endif() 66 | 67 | # Functions necessary for parallel data generation... 68 | 69 | # ... with POSIX 70 | 71 | check_function_exists(kill HAVE_KILL) 72 | check_function_exists(fork HAVE_FORK) 73 | check_function_exists(wait HAVE_WAIT) 74 | 75 | # ... on Windows (currently disabled, see the code) 76 | 77 | #check_function_exists(TerminateProcess HAVE_TERMINATE_PROCESS) 78 | #check_function_exists(spawnv HAVE_SPAWNV) 79 | #if (NOT HAVE_SPAWNV) 80 | # check_function_exists(_spawnv HAVE__SPAWNV) 81 | #endif() 82 | #check_function_exists(cwait HAVE_CWAIT) 83 | #if (NOT HAVE_CWAIT) 84 | # check_function_exists(_cwait HAVE__CWAIT) 85 | #endif() 86 | 87 | configure_file(config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/config.h @ONLY) 88 | configure_file(dists.dss ${CMAKE_BINARY_DIR}/ssb/dists.dss COPYONLY) 89 | 90 | add_executable( 91 | dbgen 92 | bcd2.c 93 | bm_utils.c 94 | build.c 95 | driver.c 96 | load_stub.c 97 | permute.c 98 | print.c 99 | rnd.c 100 | speed_seed.c 101 | text.c 102 | ) 103 | 104 | if (NOT LOG_FUNCTION_EXISTS AND NOT NEED_LINKING_AGAINST_LIBM) 105 | # Decide whether or not to link against the C math library (libm); 106 | # See: https://stackoverflow.com/q/32816646/1593077 107 | CHECK_FUNCTION_EXISTS(log LOG_FUNCTION_EXISTS) 108 | if (NOT LOG_FUNCTION_EXISTS) 109 | unset(LOG_FUNCTION_EXISTS CACHE) 110 | list(APPEND CMAKE_REQUIRED_LIBRARIES m) 111 | CHECK_FUNCTION_EXISTS(log LOG_FUNCTION_EXISTS) 112 | if (LOG_FUNCTION_EXISTS) 113 | unset(LOG_FUNCTION_EXISTS CACHE) 114 | set(NEED_LINKING_AGAINST_LIBM True CACHE BOOL "" FORCE) 115 | message(STATUS "Need linking against the C math library") 116 | else () 117 | message(FATAL_ERROR "Cannot determine how to make the C standard library math functions available") 118 | endif () 119 | else () 120 | endif () 121 | endif () 122 | 123 | if (NEED_LINKING_AGAINST_LIBM) 124 | target_link_libraries(dbgen m) 125 | endif () 126 | 127 | set_property( 128 | TARGET dbgen 129 | APPEND PROPERTY COMPILE_DEFINITIONS 130 | DBNAME="dss" 131 | ${DATABASE} 132 | ${WORKLOAD} 133 | _FILE_OFFSET_BITS=64 134 | ) 135 | 136 | set_target_properties( 137 | dbgen 138 | PROPERTIES 139 | RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/ssb 140 | ) 141 | 142 | # The following is necessary since the generated config.h will be placed 143 | # in the build directory ("binary" directory), not in the source directory 144 | target_include_directories(dbgen PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src) 145 | 146 | if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") 147 | set_property(TARGET dbgen APPEND PROPERTY COMPILE_OPTIONS -Wall -Wextra -Wno-missing-field-initializers) 148 | set_property(TARGET dbgen APPEND PROPERTY COMPILE_DEFINITIONS _POSIX_C_SOURCE=200809L) 149 | elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") 150 | set_property(TARGET dbgen APPEND PROPERTY COMPILE_OPTIONS -Wall -Wextra -Wno-missing-field-initializers) 151 | set_property(TARGET dbgen APPEND PROPERTY COMPILE_DEFINITIONS _POSIX_C_SOURCE=200809L) 152 | elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC") 153 | set_property(TARGET dbgen APPEND PROPERTY COMPILE_OPTIONS "/W3") 154 | set_property(TARGET dbgen APPEND PROPERTY COMPILE_DEFINITIONS _CRT_NONSTDC_NO_DEPRECATE _CRT_SECURE_NO_WARNINGS) 155 | endif () 156 | -------------------------------------------------------------------------------- /src/benchmarks/ssb/dbgen/bcd2.c: -------------------------------------------------------------------------------- 1 | /* @(#)bcd2.c 2.1.8.1 */ 2 | /* 3 | * bcd.c: conversion routines for multi-byte arithmetic 4 | * 5 | */ 6 | #include 7 | #include "bcd2.h" /* for function prototypes */ 8 | 9 | #define DIGITS_PER_LONG 7 10 | #define WORD_DIVISOR 10000000 11 | #define GET_DIGIT(num, low, high) \ 12 | ((num) >= DIGITS_PER_LONG)? \ 13 | (high & (0xF << (4 * ((num) - DIGITS_PER_LONG)))) \ 14 | >> (((num) - DIGITS_PER_LONG) * 4): \ 15 | (low & (0xF << (4 * (num)))) >> ((num) * 4) 16 | #define SET_DIGIT(value, num, low, high) \ 17 | if ((num) >= DIGITS_PER_LONG) \ 18 | { \ 19 | *high &= \ 20 | (0xFFFFFFF ^ (0xF << (4 * ((num) - DIGITS_PER_LONG)))); \ 21 | *high |= (value << (4 * ((num) - DIGITS_PER_LONG))); \ 22 | } \ 23 | else \ 24 | { \ 25 | *low = (*low & (0xFFFFFFF ^ (0xF << (4 * (num))))); \ 26 | *low |= (value << (4 * (num))); \ 27 | } 28 | 29 | int 30 | bin_bcd2(DSS_HUGE binary, DSS_HUGE *low_res, DSS_HUGE *high_res) 31 | { 32 | char number[15], 33 | *current; 34 | int count; 35 | DSS_HUGE *dest; 36 | 37 | *low_res = *high_res = 0; 38 | sprintf(number, "%014" HUGE_FORMAT_SPECIFIER, binary); 39 | for (current = number, count=13; *current; current++, count--) 40 | { 41 | dest = (count < DIGITS_PER_LONG)?low_res:high_res; 42 | *dest = *dest << 4; 43 | *dest |= *current - '0'; 44 | } 45 | return(0); 46 | } 47 | 48 | int 49 | bcd2_bin(DSS_HUGE *dest, DSS_HUGE bcd) 50 | { 51 | int count; 52 | DSS_HUGE mask; 53 | 54 | count = DIGITS_PER_LONG - 1; 55 | mask = 0xF000000; 56 | *dest = 0; 57 | while (mask) 58 | { 59 | *dest *= 10; 60 | *dest += (bcd & mask) >> (4 * count); 61 | mask = mask >> 4; 62 | count -= 1; 63 | } 64 | return(0); 65 | } 66 | 67 | DSS_HUGE 68 | bcd2_add(DSS_HUGE *bcd_low, DSS_HUGE *bcd_high, DSS_HUGE addend) 69 | { 70 | DSS_HUGE tmp_lo, tmp_hi, carry, res; 71 | int digit; 72 | 73 | bin_bcd2(addend, &tmp_lo, &tmp_hi); 74 | carry = 0; 75 | for (digit=0; digit < 14; digit++) 76 | { 77 | res = GET_DIGIT(digit, *bcd_low, *bcd_high); 78 | res += GET_DIGIT(digit, tmp_lo, tmp_hi); 79 | res += carry; 80 | carry = res / 10; 81 | res %= 10; 82 | SET_DIGIT(res, digit, bcd_low, bcd_high); 83 | } 84 | return(carry); 85 | } 86 | 87 | DSS_HUGE 88 | bcd2_sub(DSS_HUGE *bcd_low, DSS_HUGE *bcd_high, DSS_HUGE subend) 89 | { 90 | DSS_HUGE tmp_lo, tmp_hi, carry, res; 91 | int digit; 92 | 93 | bin_bcd2(subend, &tmp_lo, &tmp_hi); 94 | carry = 0; 95 | for (digit=0; digit < 14; digit++) 96 | { 97 | res = GET_DIGIT(digit, *bcd_low, *bcd_high); 98 | res -= GET_DIGIT(digit, tmp_lo, tmp_hi); 99 | res -= carry; 100 | if (res < 0) 101 | { 102 | res += 10; 103 | carry = 1; 104 | } 105 | SET_DIGIT(res, digit, bcd_low, bcd_high); 106 | } 107 | return(carry); 108 | } 109 | 110 | DSS_HUGE 111 | bcd2_mul(DSS_HUGE *bcd_low, DSS_HUGE *bcd_high, DSS_HUGE multiplier) 112 | { 113 | DSS_HUGE tmp_lo, tmp_hi, carry, m_lo, m_hi, m1, m2; 114 | int udigit, ldigit; 115 | DSS_HUGE res; 116 | 117 | tmp_lo = *bcd_low; 118 | tmp_hi = *bcd_high; 119 | bin_bcd2(multiplier, &m_lo, &m_hi); 120 | *bcd_low = 0; 121 | *bcd_high = 0; 122 | carry = 0; 123 | for (ldigit=0; ldigit < 14; ldigit++) 124 | { 125 | m1 = GET_DIGIT(ldigit, m_lo, m_hi); 126 | carry = 0; 127 | for (udigit=0; udigit < 14; udigit++) 128 | { 129 | m2 = GET_DIGIT(udigit, tmp_lo, tmp_hi); 130 | res = m1 * m2; 131 | res += carry; 132 | if (udigit + ldigit < 14) 133 | { 134 | carry = GET_DIGIT(udigit + ldigit, *bcd_low, *bcd_high); 135 | res += carry; 136 | } 137 | carry = res / 10; 138 | res %= 10; 139 | if (udigit + ldigit < 14) 140 | { 141 | SET_DIGIT(res, udigit + ldigit, bcd_low, bcd_high); 142 | } 143 | } 144 | } 145 | return(carry); 146 | } 147 | 148 | DSS_HUGE 149 | bcd2_div(DSS_HUGE *bcd_low, DSS_HUGE *bcd_high, DSS_HUGE divisor) 150 | { 151 | DSS_HUGE tmp_lo, tmp_hi, carry, d1, res, digit; 152 | 153 | 154 | carry = 0; 155 | tmp_lo = *bcd_low; 156 | tmp_hi = *bcd_high; 157 | *bcd_low = *bcd_high = 0; 158 | for (digit=13; digit >= 0; digit--) 159 | { 160 | d1 = GET_DIGIT(digit, tmp_lo, tmp_hi); 161 | d1 += 10 * carry; 162 | res = d1 / divisor; 163 | carry = d1 % divisor; 164 | SET_DIGIT(res, digit, bcd_low, bcd_high); 165 | } 166 | return(carry); 167 | } 168 | 169 | DSS_HUGE 170 | bcd2_mod(DSS_HUGE *bcd_low, DSS_HUGE *bcd_high, DSS_HUGE modulo) 171 | { 172 | DSS_HUGE tmp_low, tmp_high; 173 | 174 | tmp_low = *bcd_low; 175 | tmp_high = *bcd_high; 176 | while (tmp_high || tmp_low > modulo) 177 | bcd2_sub(&tmp_low, &tmp_high, modulo); 178 | return(tmp_low); 179 | } 180 | 181 | DSS_HUGE 182 | bcd2_cmp(DSS_HUGE *low1, DSS_HUGE *high1, DSS_HUGE comp) 183 | { 184 | DSS_HUGE temp = 0; 185 | 186 | bcd2_bin(&temp, *high1); 187 | if (temp > 214) 188 | return(1); 189 | bcd2_bin(&temp, *low1); 190 | return(temp - comp); 191 | } 192 | 193 | #ifdef TEST_BCD 194 | #include 195 | 196 | int main() 197 | { 198 | DSS_HUGE bin, low_bcd, high_bcd; 199 | int i; 200 | 201 | bin = MAXINT; 202 | printf("%ld\n", bin); 203 | bin_bcd2(bin, &low_bcd, &high_bcd); 204 | printf("%ld %ld\n", high_bcd, low_bcd); 205 | bin = 0; 206 | bcd2_bin(&bin, high_bcd); 207 | bcd2_bin(&bin, low_bcd); 208 | printf( "%ld\n", bin); 209 | for (i=9; i >= 0; i--) 210 | printf("%dth digit in %d is %d\n", 211 | i, bin, GET_DIGIT(i, low_bcd, high_bcd)); 212 | bcd2_add(&low_bcd, &high_bcd, MAXINT); 213 | bin = 0; 214 | bcd2_bin(&bin, high_bcd); 215 | high_bcd = bin; 216 | bin = 0; 217 | bcd2_bin(&bin, low_bcd); 218 | low_bcd = bin; 219 | printf( "%ld%07ld\n", high_bcd, low_bcd); 220 | bin_bcd2(14, &low_bcd, &high_bcd); 221 | bcd2_mul(&low_bcd, &high_bcd, 23L); 222 | bin = 0; 223 | bcd2_bin(&bin, high_bcd); 224 | bcd2_bin(&bin, low_bcd); 225 | printf( "%ld\n", bin); 226 | bcd2_div(&low_bcd, &high_bcd, 10L); 227 | bin = 0; 228 | bcd2_bin(&bin, high_bcd); 229 | bcd2_bin(&bin, low_bcd); 230 | printf( "%ld\n", bin); 231 | return(0); 232 | } 233 | #endif /* TEST */ 234 | -------------------------------------------------------------------------------- /src/benchmarks/ssb/dbgen/bcd2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Sccsid: @(#)bcd2.h 2.1.8.1 3 | */ 4 | 5 | #include "config.h" 6 | 7 | int bin_bcd2(DSS_HUGE binary, DSS_HUGE *low_res, DSS_HUGE *high_res); 8 | int bcd2_bin(DSS_HUGE *dest, DSS_HUGE bcd); 9 | DSS_HUGE bcd2_add(DSS_HUGE *bcd_low, DSS_HUGE *bcd_high, DSS_HUGE addend); 10 | DSS_HUGE bcd2_sub(DSS_HUGE *bcd_low, DSS_HUGE *bcd_high, DSS_HUGE subend); 11 | DSS_HUGE bcd2_mul(DSS_HUGE *bcd_low, DSS_HUGE *bcd_high, DSS_HUGE multiplier); 12 | DSS_HUGE bcd2_div(DSS_HUGE *bcd_low, DSS_HUGE *bcd_high, DSS_HUGE divisor); 13 | DSS_HUGE bcd2_mod(DSS_HUGE *bcd_low, DSS_HUGE *bcd_high, DSS_HUGE modulo); 14 | DSS_HUGE bcd2_cmp(DSS_HUGE *bcd_low, DSS_HUGE *bcd_high, DSS_HUGE compare); 15 | -------------------------------------------------------------------------------- /src/benchmarks/ssb/dbgen/config.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * An explanations of some of the #define's added by this file (that 3 | * don't directly originate from CMake configuration choices): 4 | * SEPARATOR -- character used to separate fields in flat files 5 | * DSS_HUGE -- 64 bit data type 6 | * HUGE_FORMAT -- printf string for 64 bit data type 7 | * HUGE_COUNT -- number of objects in DSS_HUGE 8 | * DSS_PROC -- a process-id-based random seeding factor 9 | * 10 | * DATABASE values, explained: 11 | * DB2 -- use the IBM DB2 dialect in QGEN 12 | * INFORMIX -- use the Informix dialect in QGEN 13 | * SQLSERVER -- use the Microsoft SQL Server dialect in QGEN 14 | * SYBASE -- use the Sybase dialect in QGEN 15 | * TDAT -- use Teradata dialect in QGEN 16 | */ 17 | 18 | /* POSIX platform headers */ 19 | #cmakedefine HAVE_UNISTD_H 20 | #cmakedefine HAVE_FCNTL_H 21 | #cmakedefine HAVE_SYS_WAIT_H 22 | #cmakedefine HAVE_SYS_TYPES_H 23 | #cmakedefine HAVE_SYS_STAT_H 24 | #cmakedefine HAVE_STRINGS_H 25 | #cmakedefine HAVE_INTTYPES_H 26 | 27 | /* Windows platform headers */ 28 | #cmakedefine HAVE_PROCESS_H 29 | #cmakedefine HAVE_WINDOWS_H 30 | 31 | /* Non-platform-specific headers */ 32 | #cmakedefine HAVE_STDINT_H 33 | #cmakedefine HAVE_SYS_BITTYPES_H 34 | #cmakedefine HAVE_MALLOC_IN_STDLIB 35 | #cmakedefine HAVE_MALLOC_H 36 | 37 | #define RNG_TEST 38 | #define _FILE_OFFSET_BITS 64 39 | 40 | /* SIZEOF_LONG check */ 41 | #if (@SIZEOF_LONG@ == 8) 42 | #define SIGNED_64_BIT_C_TYPE long 43 | #define SIGNED_64_BIT_PRINTF_MODIFIER "l" 44 | #else 45 | /* SIZEOF_LONG_LONG check */ 46 | #if (@SIZEOF_LONG_LONG@ == 8) 47 | #define SIGNED_64_BIT_C_TYPE long long 48 | #define SIGNED_64_BIT_PRINTF_MODIFIER "ll" 49 | #else 50 | /* SIZEOF_SHORT check */ 51 | #if (@SIZEOF_SHORT@ == 8) 52 | #define SIGNED_64_BIT_C_TYPE short 53 | #define SIGNED_64_BIT_PRINTF_MODIFIER "s" 54 | #else 55 | /* SIZEOF_INT check */ 56 | #if (@SIZEOF_INT@ == 8) 57 | #define SIGNED_64_BIT_C_TYPE int 58 | #define SIGNED_64_BIT_PRINTF_MODIFIER 59 | #else 60 | #error "No standard C integer type has size 8" 61 | #endif 62 | #endif 63 | #endif 64 | #endif 65 | 66 | #define SUPPORT_64BITS 67 | 68 | #define DSS_HUGE SIGNED_64_BIT_C_TYPE 69 | #define HUGE_FORMAT_SPECIFIER SIGNED_64_BIT_PRINTF_MODIFIER "d" 70 | #define HUGE_FORMAT "%" HUGE_FORMAT_SPECIFIER 71 | #define HUGE_COUNT 1 72 | #define HUGE_DATE_FORMAT "%02" HUGE_FORMAT_SPECIFIER 73 | 74 | #cmakedefine01 CSV_OUTPUT_FORMAT 75 | #if CSV_OUTPUT_FORMAT 76 | #define SEPARATOR ',' /* field spearator for generated flat files */ 77 | #define DOUBLE_QUOTE_OUTPUT_STRINGS /* In the SSB data set, we may have commas in strings, so let's enclose (all of) them in quotes. */ 78 | #ifndef EOL_HANDLING 79 | #define EOL_HANDLING /* Note: This should already be defined by CMake; only "emphasizing" here */ 80 | #endif 81 | #else 82 | #define SEPARATOR '|' 83 | #endif 84 | 85 | #cmakedefine EOL_HANDLING 86 | #cmakedefine YMD_DASH_DATE 87 | 88 | #cmakedefine HAVE_GETOPT_H 89 | #cmakedefine STDLIB_HAS_GETOPT 90 | #cmakedefine STDLIB_HAS_GETENV 91 | 92 | #if (defined(STDLIB_HAS_GETOPT) || defined(HAVE_GETOPT_H)) 93 | #define HAVE_GETOPT 94 | #endif 95 | 96 | #cmakedefine01 HAVE_GETPID 97 | #if (HAVE_GETPID == 1) 98 | #define DSS_PROC getpid() 99 | #else 100 | #define DSS_PROC 1 101 | #endif 102 | 103 | #cmakedefine HAVE_KILL 104 | #cmakedefine HAVE_FORK 105 | #cmakedefine HAVE_WAIT 106 | 107 | #define RNG_A 6364136223846793005ull 108 | #define RNG_C 1ull 109 | 110 | #if (defined(_WIN32) && !defined(_POSIX)) || defined(__CYGWIN__) 111 | #define PATH_SEP '\\' 112 | #else 113 | #define PATH_SEP '/' 114 | #endif 115 | 116 | #if (!defined(HAVE_UNISTD_H) && !defined(HAVE_PID_T_IN_SYS_TYPES_H)) 117 | typedef int pid_t; 118 | #endif 119 | 120 | #ifdef _MSC_VER 121 | 122 | /* Disable warnings about "foo() converted to foo(void)" */ 123 | #pragma warning(disable:4255) 124 | 125 | /* Disable warnings about "added padding to struct data members" */ 126 | #pragma warning(disable:4820) 127 | 128 | /* Disable warnings about "function not inlined" */ 129 | #pragma warning(disable:4710) 130 | #endif 131 | 132 | -------------------------------------------------------------------------------- /src/benchmarks/ssb/dbgen/life_noise.h: -------------------------------------------------------------------------------- 1 | #ifndef LIFE_NOISE_H 2 | #define LIFE_NOISE_H 3 | 4 | #define LN_CNT 4 5 | static char lnoise[LN_CNT] = {'|', '/', '-', '\\' }; 6 | #define LIFENOISE(n, var) \ 7 | if (verbose > 0) fprintf(stderr, "%c\b", lnoise[(var%LN_CNT)]) 8 | 9 | #endif /* LIFE_NOISE_H */ 10 | -------------------------------------------------------------------------------- /src/benchmarks/ssb/dbgen/load_stub.c: -------------------------------------------------------------------------------- 1 | /***************************************************************** 2 | * Title: load_stub.c 3 | * Sccsid: @(#)load_stub.c 2.1.8.1 4 | * Description: 5 | * stub routines for: 6 | * inline load of dss benchmark 7 | * header creation for dss benchmark 8 | * 9 | ***************************************************************** 10 | */ 11 | 12 | #include 13 | #include "config.h" 14 | #include "dss.h" 15 | #include "dsstypes.h" 16 | 17 | int 18 | close_direct(void) 19 | { 20 | /* any post load cleanup goes here */ 21 | return(0); 22 | } 23 | 24 | int 25 | prep_direct(void) 26 | { 27 | /* any preload prep goes here */ 28 | return(0); 29 | } 30 | 31 | int 32 | hd_cust (FILE *f) 33 | { 34 | static int count = 0; 35 | 36 | UNUSED(f); 37 | if (! count++) 38 | printf("No header has been defined for the customer table\n"); 39 | 40 | return(0); 41 | } 42 | 43 | int 44 | ld_cust (customer_t *cp, int mode) 45 | { 46 | static int count = 0; 47 | 48 | UNUSED(cp); 49 | UNUSED(mode); 50 | if (! count++) 51 | printf("%s %s\n", 52 | "No load routine has been defined", 53 | "for the customer table"); 54 | 55 | return(0); 56 | } 57 | 58 | int 59 | hd_part (FILE *f) 60 | { 61 | static int count = 0; 62 | 63 | UNUSED(f); 64 | if (! count++) 65 | printf("No header has been defined for the part table\n"); 66 | 67 | return(0); 68 | } 69 | 70 | int 71 | ld_part (part_t *pp, int mode) 72 | { 73 | static int count = 0; 74 | 75 | UNUSED(pp); 76 | UNUSED(mode); 77 | if (! count++) 78 | printf("No load routine has been defined for the part table\n"); 79 | 80 | return(0); 81 | } 82 | 83 | int 84 | ld_psupp (part_t *pp, int mode) 85 | { 86 | static int count = 0; 87 | 88 | UNUSED(pp); 89 | UNUSED(mode); 90 | if (! count++) 91 | printf("%s %s\n", 92 | "No load routine has been defined for the", 93 | "psupp table\n"); 94 | 95 | return(0); 96 | 97 | } 98 | 99 | 100 | int 101 | hd_supp (FILE *f) 102 | { 103 | static int count = 0; 104 | 105 | UNUSED(f); 106 | if (! count++) 107 | printf("No header has been defined for the supplier table\n"); 108 | 109 | return(0); 110 | } 111 | 112 | int 113 | ld_supp (supplier_t *sp, int mode) 114 | { 115 | static int count = 0; 116 | 117 | UNUSED(sp); 118 | UNUSED(mode); 119 | if (! count++) 120 | printf("%s %s\n", 121 | "No load routine has been defined", 122 | "for the supplier table\n"); 123 | 124 | return(0); 125 | } 126 | 127 | 128 | int 129 | hd_order (FILE *f) 130 | { 131 | static int count = 0; 132 | 133 | UNUSED(f); 134 | if (! count++) 135 | printf("No header has been defined for the order table\n"); 136 | 137 | return(0); 138 | } 139 | 140 | int 141 | ld_order (order_t *p, int mode) 142 | { 143 | static int count = 0; 144 | 145 | UNUSED(p); 146 | UNUSED(mode); 147 | if (! count++) 148 | printf("%s %s\n", 149 | "No load routine has been defined", 150 | "for the order table"); 151 | 152 | return(0); 153 | } 154 | 155 | int ld_line (order_t *p, int mode) 156 | { 157 | static int count = 0; 158 | 159 | UNUSED(p); 160 | UNUSED(mode); 161 | if (! count++) 162 | printf("%s %s\n", 163 | "No load routine has been defined", 164 | "for the line table"); 165 | 166 | return(0); 167 | } 168 | 169 | 170 | 171 | int 172 | hd_psupp (FILE *f) 173 | { 174 | static int count = 0; 175 | 176 | UNUSED(f); 177 | if (! count++) 178 | printf("%s %s\n", 179 | "No header has been defined for the", 180 | "part supplier table"); 181 | 182 | return(0); 183 | } 184 | 185 | 186 | int 187 | hd_line (FILE *f) 188 | { 189 | static int count = 0; 190 | 191 | UNUSED(f); 192 | if (! count++) 193 | printf("No header has been defined for the lineitem table\n"); 194 | 195 | return(0); 196 | } 197 | 198 | int 199 | hd_nation (FILE *f) 200 | { 201 | static int count = 0; 202 | 203 | UNUSED(f); 204 | if (! count++) 205 | printf("No header has been defined for the nation table\n"); 206 | 207 | return(0); 208 | } 209 | 210 | #ifdef SSB 211 | #else 212 | int 213 | ld_nation (code_t *cp, int mode) 214 | { 215 | static int count = 0; 216 | 217 | UNUSED(cp); 218 | UNUSED(mode); 219 | if (! count++) 220 | printf("%s %s\n", 221 | "No load routine has been defined", 222 | "for the nation table"); 223 | 224 | return(0); 225 | } 226 | 227 | int 228 | hd_region (FILE *f) 229 | { 230 | static int count = 0; 231 | 232 | if (! count++) 233 | printf("No header has been defined for the region table\n"); 234 | 235 | return(0); 236 | } 237 | 238 | int 239 | ld_region (code_t *cp, int mode) 240 | { 241 | static int count = 0; 242 | 243 | if (! count++) 244 | printf("%s %s\n", 245 | "No load routine has been defined", 246 | "for the region table"); 247 | 248 | return(0); 249 | } 250 | 251 | int 252 | ld_order_line (order_t *p, int mode) 253 | { 254 | ld_order(p, mode); 255 | ld_line (p, mode); 256 | 257 | return(0); 258 | } 259 | 260 | int 261 | hd_order_line (FILE *f) 262 | { 263 | hd_order(f); 264 | hd_line (f); 265 | 266 | return(0); 267 | } 268 | 269 | int 270 | ld_part_psupp (part_t *p, int mode) 271 | { 272 | ld_part(p, mode); 273 | ld_psupp (p, mode); 274 | 275 | return(0); 276 | } 277 | 278 | int 279 | hd_part_psupp (FILE *f) 280 | { 281 | hd_part(f); 282 | hd_psupp(f); 283 | 284 | return(0); 285 | } 286 | #endif 287 | 288 | #ifdef SSB 289 | int 290 | ld_date (date_t *d, int mode) 291 | { 292 | UNUSED(d); 293 | UNUSED(mode); 294 | /*do nothing for now*/ 295 | return(0); 296 | } 297 | 298 | #endif 299 | 300 | 301 | 302 | 303 | 304 | 305 | -------------------------------------------------------------------------------- /src/benchmarks/ssb/dbgen/permute.c: -------------------------------------------------------------------------------- 1 | /* @(#)permute.c 2.1.8.3 */ 2 | /* 3 | * permute.c -- a permutation generator for the query 4 | * sequences in TPC-H and TPC-R 5 | */ 6 | 7 | #ifdef TEST 8 | #define DECLARER 9 | #endif 10 | #include "config.h" 11 | #include "dss.h" 12 | 13 | #ifdef TEST 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #ifdef HAVE_STRINGS_H 23 | #include 24 | #endif /* HAVE_STRINGS_H */ 25 | #if (defined(HAVE_UNISTD_H) && defined(HAVE_SYS_WAIT_H)) // POSIX-compatible system 26 | #include 27 | #include 28 | #elif (defined(HAVE_PROCESS_H) && defined(HAVE_WINDOWS_H)) // Windows system 29 | #include 30 | #ifdef _MSC_VER 31 | #pragma warning(disable:4201) 32 | #pragma warning(disable:4214) 33 | #pragma warning(disable:4514) 34 | #endif 35 | #define WIN32_LEAN_AND_MEAN 36 | #define NOATOM 37 | #define NOGDICAPMASKS 38 | #define NOMETAFILE 39 | #define NOMINMAX 40 | #define NOMSG 41 | #define NOOPENFILE 42 | #define NORASTEROPS 43 | #define NOSCROLL 44 | #define NOSOUND 45 | #define NOSYSMETRICS 46 | #define NOTEXTMETRIC 47 | #define NOWH 48 | #define NOCOMM 49 | #define NOKANJI 50 | #define NOMCX 51 | #include 52 | #ifdef _MSC_VER 53 | #pragma warning(default:4201) 54 | #pragma warning(default:4214) 55 | #endif 56 | #endif /* (defined(HAVE_UNISTD_H) && defined(HAVE_SYS_WAIT_H)) */ 57 | #endif /* TEST */ 58 | 59 | long NextRand(long seed); 60 | long *permute(long *set, int cnt, long stream); 61 | long *permute_dist(distribution *d, long stream); 62 | long seed; 63 | char *eol[2] = {" ", "},"}; 64 | extern seed_t Seed[]; 65 | #ifdef TEST 66 | tdef tdefs = { NULL }; 67 | #endif 68 | 69 | 70 | #define MAX_QUERY 22 71 | #define ITERATIONS 1000 72 | #define UNSET 0 73 | 74 | long * 75 | permute(long *a, int c, long s) 76 | { 77 | int i; 78 | static long source; 79 | static long *set, temp; 80 | 81 | if (a != (long *)NULL) 82 | { 83 | set = a; 84 | for (i=0; i < c; i++) 85 | *(a + i) = i; 86 | for (i=0; i < c; i++) 87 | { 88 | RANDOM(source, 0L, (long)(c - 1), s); 89 | temp = *(a + source); 90 | *(a + source) = *(a + i) ; 91 | *(a + i) = temp; 92 | source = 0; 93 | } 94 | } 95 | else 96 | source += 1; 97 | 98 | if (source >= c) 99 | source -= c; 100 | 101 | return(set + source); 102 | } 103 | 104 | long * 105 | permute_dist(distribution *d, long stream) 106 | { 107 | static distribution *dist = NULL; 108 | int i; 109 | 110 | if (d != NULL) 111 | { 112 | if (d->permute == (long *)NULL) 113 | { 114 | d->permute = (long *)malloc(sizeof(long) * DIST_SIZE(d)); 115 | MALLOC_CHECK(d->permute); 116 | for (i=0; i < DIST_SIZE(d); i++) 117 | *(d->permute + i) = i; 118 | } 119 | dist = d; 120 | return(permute(dist->permute, DIST_SIZE(dist), stream)); 121 | } 122 | 123 | 124 | if (dist != NULL) 125 | return(permute(NULL, DIST_SIZE(dist), stream)); 126 | else 127 | INTERNAL_ERROR("Bad call to permute_dist"); 128 | } 129 | 130 | 131 | #ifdef TEST 132 | 133 | int main(int ac, char *av[]) 134 | { 135 | long *sequence, 136 | i, 137 | j, 138 | streams = UNSET, 139 | *a; 140 | char sep; 141 | int index = 0; 142 | 143 | set_seeds = 0; 144 | sequence = (long *)malloc(MAX_QUERY * sizeof(long)); 145 | a = sequence; 146 | for (i=0; i < MAX_QUERY; i++) 147 | *(sequence + i) = i; 148 | if (ac < 3) 149 | goto usage; 150 | Seed[0].value = (long)atoi(av[1]); 151 | streams = atoi(av[2]); 152 | if (Seed[0].value == UNSET || streams == UNSET) 153 | goto usage; 154 | 155 | index = 0; 156 | printf("long permutation[%d][%d] = {\n", streams, MAX_QUERY); 157 | for (j=0; j < streams; j++) 158 | { 159 | sep = '{'; 160 | printf("%s\n", eol[index]); 161 | for (i=0; i < MAX_QUERY; i++) 162 | { 163 | printf("%c%2d", sep, *permute(a, MAX_QUERY, 0) + 1); 164 | a = (long *)NULL; 165 | sep = ','; 166 | } 167 | a = sequence; 168 | index=1; 169 | } 170 | printf("}\n};\n"); 171 | return(0); 172 | 173 | usage: 174 | printf("Usage: %s \n",av[0]); 175 | printf(" uses to start the generation of permutations of [1..%d]\n", MAX_QUERY); 176 | return(-1); 177 | 178 | } 179 | #endif /* TEST */ 180 | -------------------------------------------------------------------------------- /src/benchmarks/ssb/dbgen/permute.h: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)permute.h 2.1.8.1 3 | */ 4 | long permutation[41][22] = 5 | { 6 | {14, 2, 9,20, 6,17,18, 8,21,13, 3,22,16, 4,11,15, 1,10,19, 5, 7,12}, 7 | {21, 3,18, 5,11, 7, 6,20,17,12,16,15,13,10, 2, 8,14,19, 9,22, 1, 4}, 8 | { 6,17,14,16,19,10, 9, 2,15, 8, 5,22,12, 7,13,18, 1, 4,20, 3,11,21}, 9 | { 8, 5, 4, 6,17, 7, 1,18,22,14, 9,10,15,11,20, 2,21,19,13,16,12, 3}, 10 | { 5,21,14,19,15,17,12, 6, 4, 9, 8,16,11, 2,10,18, 1,13, 7,22, 3,20}, 11 | {21,15, 4, 6, 7,16,19,18,14,22,11,13, 3, 1, 2, 5, 8,20,12,17,10, 9}, 12 | {10, 3,15,13, 6, 8, 9, 7, 4,11,22,18,12, 1, 5,16, 2,14,19,20,17,21}, 13 | {18, 8,20,21, 2, 4,22,17, 1,11, 9,19, 3,13, 5, 7,10,16, 6,14,15,12}, 14 | {19, 1,15,17, 5, 8, 9,12,14, 7, 4, 3,20,16, 6,22,10,13, 2,21,18,11}, 15 | { 8,13, 2,20,17, 3, 6,21,18,11,19,10,15, 4,22, 1, 7,12, 9,14, 5,16}, 16 | { 6,15,18,17,12, 1, 7, 2,22,13,21,10,14, 9, 3,16,20,19,11, 4, 8, 5}, 17 | {15,14,18,17,10,20,16,11, 1, 8, 4,22, 5,12, 3, 9,21, 2,13, 6,19, 7}, 18 | { 1, 7,16,17,18,22,12, 6, 8, 9,11, 4, 2, 5,20,21,13,10,19, 3,14,15}, 19 | {21,17, 7, 3, 1,10,12,22, 9,16, 6,11, 2, 4, 5,14, 8,20,13,18,15,19}, 20 | { 2, 9, 5, 4,18, 1,20,15,16,17, 7,21,13,14,19, 8,22,11,10, 3,12, 6}, 21 | {16, 9,17, 8,14,11,10,12, 6,21, 7, 3,15, 5,22,20, 1,13,19, 2, 4,18}, 22 | { 1, 3, 6, 5, 2,16,14,22,17,20, 4, 9,10,11,15, 8,12,19,18,13, 7,21}, 23 | { 3,16, 5,11,21, 9, 2,15,10,18,17, 7, 8,19,14,13, 1, 4,22,20, 6,12}, 24 | {14, 4,13, 5,21,11, 8, 6, 3,17, 2,20, 1,19,10, 9,12,18,15, 7,22,16}, 25 | { 4,12,22,14, 5,15,16, 2, 8,10,17, 9,21, 7, 3, 6,13,18,11,20,19, 1}, 26 | {16,15,14,13, 4,22,18,19, 7, 1,12,17, 5,10,20, 3, 9,21,11, 2, 6, 8}, 27 | {20,14,21,12,15,17, 4,19,13,10,11, 1,16, 5,18, 7, 8,22, 9, 6, 3, 2}, 28 | {16,14,13, 2,21,10,11, 4, 1,22,18,12,19, 5, 7, 8, 6, 3,15,20, 9,17}, 29 | {18,15, 9,14,12, 2, 8,11,22,21,16, 1, 6,17, 5,10,19, 4,20,13, 3, 7}, 30 | { 7, 3,10,14,13,21,18, 6,20, 4, 9, 8,22,15, 2, 1, 5,12,19,17,11,16}, 31 | {18, 1,13, 7,16,10,14, 2,19, 5,21,11,22,15, 8,17,20, 3, 4,12, 6, 9}, 32 | {13, 2,22, 5,11,21,20,14, 7,10, 4, 9,19,18, 6, 3, 1, 8,15,12,17,16}, 33 | {14,17,21, 8, 2, 9, 6, 4, 5,13,22, 7,15, 3, 1,18,16,11,10,12,20,19}, 34 | {10,22, 1,12,13,18,21,20, 2,14,16, 7,15, 3, 4,17, 5,19, 6, 8, 9,11}, 35 | {10, 8, 9,18,12, 6, 1, 5,20,11,17,22,16, 3,13, 2,15,21,14,19, 7, 4}, 36 | { 7,17,22, 5, 3,10,13,18, 9, 1,14,15,21,19,16,12, 8, 6,11,20, 4, 2}, 37 | { 2, 9,21, 3, 4, 7, 1,11,16, 5,20,19,18, 8,17,13,10,12,15, 6,14,22}, 38 | {15,12, 8, 4,22,13,16,17,18, 3, 7, 5, 6, 1, 9,11,21,10,14,20,19, 2}, 39 | {15,16, 2,11,17, 7, 5,14,20, 4,21, 3,10, 9,12, 8,13, 6,18,19,22, 1}, 40 | { 1,13,11, 3, 4,21, 6,14,15,22,18, 9, 7, 5,10,20,12,16,17, 8,19, 2}, 41 | {14,17,22,20, 8,16, 5,10, 1,13, 2,21,12, 9, 4,18, 3, 7, 6,19,15,11}, 42 | { 9,17, 7, 4, 5,13,21,18,11, 3,22, 1, 6,16,20,14,15,10, 8, 2,12,19}, 43 | {13,14, 5,22,19,11, 9, 6,18,15, 8,10, 7, 4,17,16, 3, 1,12, 2,21,20}, 44 | {20, 5, 4,14,11, 1, 6,16, 8,22, 7, 3, 2,12,21,19,17,13,10,15,18, 9}, 45 | { 3, 7,14,15, 6, 5,21,20,18,10, 4,16,19, 1,13, 9, 8,17,11,12,22, 2}, 46 | {13,15,17, 1,22,11, 3, 4, 7,20,14,21, 9, 8, 2,18,16, 6,10,12, 5,19} 47 | }; 48 | -------------------------------------------------------------------------------- /src/benchmarks/ssb/dbgen/rnd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Sccsid: @(#)rnd.h 2.1.8.1 3 | * 4 | * rnd.h -- header file for use withthe portable random number generator 5 | * provided by Frank Stephens of Unisys 6 | */ 7 | 8 | /* function protypes */ 9 | long NextRand PROTO((long)); 10 | long UnifInt PROTO((long, long, long)); 11 | double UnifReal PROTO((double, double, long)); 12 | double Exponential PROTO((double, long)); 13 | 14 | static long nA = 16807; /* the multiplier */ 15 | static long nM = 2147483647;/* the modulus == 2^31 - 1 */ 16 | static long nQ = 127773; /* the quotient nM / nA */ 17 | static long nR = 2836; /* the remainder nM % nA */ 18 | 19 | static double dM = 2147483647.0; 20 | 21 | /* 22 | * macros to control RNG and assure reproducible multi-stream 23 | * runs without the need for seed files. Keep track of invocations of RNG 24 | * and always round-up to a known per-row boundary. 25 | */ 26 | /* 27 | * preferred solution, but not initializing correctly 28 | */ 29 | #define VSTR_MAX(len) (long)(len / 5 + (len % 5 == 0)?0:1 + 1) 30 | seed_t Seed[MAX_STREAM + 1] = 31 | { 32 | {PART, 1, 0, 1}, /* P_MFG_SD 0 */ 33 | {PART, 46831694, 0, 1}, /* P_BRND_SD 1 */ 34 | {PART, 1841581359, 0, 1}, /* P_TYPE_SD 2 */ 35 | {PART, 1193163244, 0, 1}, /* P_SIZE_SD 3 */ 36 | {PART, 727633698, 0, 1}, /* P_CNTR_SD 4 */ 37 | {NONE, 933588178, 0, 1}, /* P_RCST_SD 5 UNUSED 2-4-98 */ 38 | {PART, 804159733, 0, RNG_PER_SENT * 3}, /* P_CMNT_SD 6 */ 39 | {PSUPP, 1671059989, 0, SUPP_PER_PART}, /* PS_QTY_SD 7 */ 40 | {PSUPP, 1051288424, 0, SUPP_PER_PART}, /* PS_SCST_SD 8 */ 41 | {PSUPP, 1961692154, 0, SUPP_PER_PART * RNG_PER_SENT * 20}, /* PS_CMNT_SD 9 */ 42 | {ORDER, 1227283347, 0, 1}, /* O_SUPP_SD 10 */ 43 | {ORDER, 1171034773, 0, 1}, /* O_CLRK_SD 11 */ 44 | {ORDER, 276090261, 0, RNG_PER_SENT * 8}, /* O_CMNT_SD 12 */ 45 | {ORDER, 1066728069, 0, 1}, /* O_ODATE_SD 13 */ 46 | {LINE, 209208115, 0, O_LCNT_MAX}, /* L_QTY_SD 14 */ 47 | {LINE, 554590007, 0, O_LCNT_MAX}, /* L_DCNT_SD 15 */ 48 | {LINE, 721958466, 0, O_LCNT_MAX}, /* L_TAX_SD 16 */ 49 | {LINE, 1371272478, 0, O_LCNT_MAX}, /* L_SHIP_SD 17 */ 50 | {LINE, 675466456, 0, O_LCNT_MAX}, /* L_SMODE_SD 18 */ 51 | {LINE, 1808217256, 0, O_LCNT_MAX}, /* L_PKEY_SD 19 */ 52 | {LINE, 2095021727, 0, O_LCNT_MAX}, /* L_SKEY_SD 20 */ 53 | {LINE, 1769349045, 0, O_LCNT_MAX}, /* L_SDTE_SD 21 */ 54 | {LINE, 904914315, 0, O_LCNT_MAX}, /* L_CDTE_SD 22 */ 55 | {LINE, 373135028, 0, O_LCNT_MAX}, /* L_RDTE_SD 23 */ 56 | {LINE, 717419739, 0, O_LCNT_MAX}, /* L_RFLG_SD 24 */ 57 | {LINE, 1095462486, 0, O_LCNT_MAX * RNG_PER_SENT * 5}, /* L_CMNT_SD 25 */ 58 | {CUST, 881155353, 0, 9}, /* C_ADDR_SD 26 */ 59 | {CUST, 1489529863, 0, 1}, /* C_NTRG_SD 27 */ 60 | {CUST, 1521138112, 0, 3}, /* C_PHNE_SD 28 */ 61 | {CUST, 298370230, 0, 1}, /* C_ABAL_SD 29 */ 62 | {CUST, 1140279430, 0, 1}, /* C_MSEG_SD 30 */ 63 | {CUST, 1335826707, 0, RNG_PER_SENT * 12}, /* C_CMNT_SD 31 */ 64 | {SUPP, 706178559, 0, 9}, /* S_ADDR_SD 32 */ 65 | {SUPP, 110356601, 0, 1}, /* S_NTRG_SD 33 */ 66 | {SUPP, 884434366, 0, 3}, /* S_PHNE_SD 34 */ 67 | {SUPP, 962338209, 0, 1}, /* S_ABAL_SD 35 */ 68 | {SUPP, 1341315363, 0, RNG_PER_SENT * 11}, /* S_CMNT_SD 36 */ 69 | {PART, 709314158, 0, 92}, /* P_NAME_SD 37 */ 70 | {ORDER, 591449447, 0, 1}, /* O_PRIO_SD 38 */ 71 | {LINE, 431918286, 0, 1}, /* HVAR_SD 39 */ 72 | {ORDER, 851767375, 0, 1}, /* O_CKEY_SD 40 */ 73 | {NATION, 606179079, 0, RNG_PER_SENT * 16}, /* N_CMNT_SD 41 */ 74 | {REGION, 1500869201, 0, RNG_PER_SENT * 16}, /* R_CMNT_SD 42 */ 75 | {ORDER, 1434868289, 0, 1}, /* O_LCNT_SD 43 */ 76 | {SUPP, 263032577, 0, 1}, /* BBB offset 44 */ 77 | {SUPP, 753643799, 0, 1}, /* BBB type 45 */ 78 | {SUPP, 202794285, 0, 1}, /* BBB comment 46 */ 79 | {SUPP, 715851524, 0, 1} /* BBB junk 47 */ 80 | #ifdef SSB 81 | , 82 | {PART, 637858759, 0, 1}, /* P_CAT_SD 48 */ 83 | {SUPP, 1495190827, 0, 1} /* P_CITY_SD 49 */ 84 | #endif 85 | }; 86 | -------------------------------------------------------------------------------- /src/benchmarks/ssb/dbgen/shared.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Sccsid: @(#)shared.h 2.1.8.1 3 | * Modified for SSB 4 | */ 5 | #define N_CMNT_LEN 72 6 | #define N_CMNT_MAX 152 7 | #define R_CMNT_LEN 72 8 | #define R_CMNT_MAX 152 9 | #define MONEY_SCL 0.01 10 | #define V_STR_HGH 1.6 11 | 12 | #ifdef SSB 13 | #define P_NAME_LEN 22 14 | #define P_MFG_LEN 6 15 | #define P_COLOR_LEN 3 16 | #define P_COLOR_MAX 11 17 | #define P_TYPE_MAX 25 18 | #define P_CAT_LEN 7 19 | #define P_CAT_MIN 1 20 | #define P_CAT_MAX 5 21 | /* 22 | * 23 | * In the originally-published version of this file, 24 | * the following definition was included: 25 | * 26 | * #define P_CAT_SD 97 27 | * 28 | * but that's inappropriate, both since seeds are defined in dss.h, 29 | * and because it exceeds MAX_STREAM, so it's not covered by the Seed 30 | * array (see rnd.h). Now, magically, this often didn't trigger 31 | * a segmentation fault, despite out-of-bounds access to Seed[P_CAT_SD]; 32 | * but the value was junk; or maybe it was 0, due to some fortunate 33 | * coincidence. 34 | * 35 | * At any rate, this was moved and changed. 36 | */ 37 | #define S_NATION_NAME_LEN 15 38 | #define S_REGION_NAME_LEN 12 39 | #define C_NATION_NAME_LEN 15 40 | #define C_REGION_NAME_LEN 12 41 | #define C_NAT_SD 16 42 | #define C_REG_SD 3 43 | #define O_SHIP_STRU_LEN 25 44 | #define O_SHIP_MODE_LEN 10 45 | #define O_SHIP_PRIO_LEN 1 46 | #define D_DATE_LEN 18 47 | #define D_DAYWEEK_LEN 9 48 | #define D_YEARMONTH_LEN 7 49 | #define D_SEASON_LEN 12 50 | #define D_MONTH_LEN 9 51 | #define D_STARTDATE 694245661 /*corresponding to 1/1/1992 1:1:1*/ 52 | #define NAMTION_BRIEF_LEN 9 53 | #define CITY_CODE_SEED 15 54 | #define NUM_DAYS 2556 55 | #define NUM_SEASONS 5 56 | #define NUM_HOLIDAYS 10 57 | #define CITY_FIX 10 58 | #else 59 | 60 | #define P_NAME_LEN 55 61 | #define P_MFG_LEN 25 62 | 63 | #endif 64 | 65 | #define P_BRND_LEN 10 66 | 67 | #ifdef SSB 68 | #define P_TYPE_LEN 12 69 | 70 | #else 71 | 72 | #define P_TYPE_LEN 25 73 | 74 | #endif 75 | 76 | #define P_CNTR_LEN 10 77 | #define P_CMNT_LEN 14 78 | #define P_CMNT_MAX 23 79 | #define P_CAT_SEED 25 80 | 81 | #define S_NAME_LEN 25 82 | 83 | #ifdef SSB 84 | #define S_ADDR_LEN 15 85 | #define S_ADDR_MAX 25 86 | #else 87 | 88 | #define S_ADDR_LEN 25 89 | #define S_ADDR_MAX 40 90 | #endif 91 | 92 | #define S_CMNT_LEN 63 93 | #define S_CMNT_MAX 101 94 | #define PS_CMNT_LEN 124 95 | #define PS_CMNT_MAX 199 96 | 97 | #ifdef SSB 98 | #define C_NAME_LEN 25 99 | #define C_MSEG_MIN 1 100 | #define C_MSEG_MAX 5 101 | #define C_ADDR_LEN 15 102 | #define C_ADDR_MAX 25 103 | #else 104 | #define C_NAME_LEN 18 105 | #define C_ADDR_LEN 25 106 | #define C_ADDR_MAX 40 107 | #endif 108 | 109 | #define C_MSEG_LEN 10 110 | #define C_CMNT_LEN 73 111 | #define C_CMNT_MAX 117 112 | 113 | #ifdef SSB 114 | #define O_OPRIO_LEN 8 115 | 116 | #else 117 | #define O_OPRIO_LEN 15 118 | 119 | #endif 120 | 121 | #define O_CLRK_LEN 15 122 | #define O_CMNT_LEN 49 123 | #define O_CMNT_MAX 79 124 | #define L_CMNT_LEN 27 125 | #define L_CMNT_MAX 44 126 | #define L_INST_LEN 25 127 | #define L_SMODE_LEN 10 128 | #define T_ALPHA_LEN 10 129 | #define DATE_LEN 13 /* long enough to hold either date format */ 130 | #define NATION_LEN 25 131 | #define REGION_LEN 25 132 | #define PHONE_LEN 15 133 | 134 | #ifdef SSB 135 | #define MAXAGG_LEN 15 /* max component length for agg str; longest string is "4-NOT SPECIFIED" */ 136 | #else 137 | #define MAXAGG_LEN 20 /* max component length for a agg str */ 138 | #endif 139 | 140 | #define P_CMNT_SD 6 141 | #define PS_CMNT_SD 9 142 | #define O_CMNT_SD 12 143 | #define C_ADDR_SD 26 144 | #define C_CMNT_SD 31 145 | #define S_ADDR_SD 32 146 | #define S_CMNT_SD 36 147 | #define L_CMNT_SD 25 148 | 149 | 150 | 151 | 152 | 153 | 154 | -------------------------------------------------------------------------------- /src/benchmarks/ssb/helpers.hpp: -------------------------------------------------------------------------------- 1 | #ifndef SQLITE_PERFORMANCE_SSB_HELPERS_HPP 2 | #define SQLITE_PERFORMANCE_SSB_HELPERS_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | template double time(F &&f) { 10 | auto t0 = std::chrono::high_resolution_clock::now(); 11 | f(); 12 | auto t1 = std::chrono::high_resolution_clock::now(); 13 | return std::chrono::duration(t1 - t0).count(); 14 | } 15 | 16 | cxxopts::Options ssb_options(const std::string &program, 17 | const std::string &help_string = "") { 18 | cxxopts::Options options(program, help_string); 19 | cxxopts::OptionAdder adder = options.add_options(); 20 | adder("help", "Print help"); 21 | return options; 22 | } 23 | 24 | #endif // SQLITE_PERFORMANCE_SSB_HELPERS_HPP 25 | -------------------------------------------------------------------------------- /src/benchmarks/ssb/sql/init/duckdb.sql: -------------------------------------------------------------------------------- 1 | PRAGMA memory_limit = '8GB'; 2 | 3 | DROP TABLE IF EXISTS lineorder; 4 | DROP TABLE IF EXISTS part; 5 | DROP TABLE IF EXISTS supplier; 6 | DROP TABLE IF EXISTS customer; 7 | DROP TABLE IF EXISTS date; 8 | 9 | CREATE TABLE part 10 | ( 11 | p_partkey UINTEGER, 12 | p_name VARCHAR, 13 | p_mfgr VARCHAR, 14 | p_category VARCHAR, 15 | p_brand1 VARCHAR, 16 | p_color VARCHAR, 17 | p_type VARCHAR, 18 | p_size UTINYINT, 19 | p_container VARCHAR, 20 | PRIMARY KEY (p_partkey) 21 | ); 22 | 23 | CREATE TABLE supplier 24 | ( 25 | s_suppkey UINTEGER, 26 | s_name VARCHAR, 27 | s_address VARCHAR, 28 | s_city VARCHAR, 29 | s_nation VARCHAR, 30 | s_region VARCHAR, 31 | s_phone VARCHAR, 32 | PRIMARY KEY (s_suppkey) 33 | ); 34 | 35 | CREATE TABLE customer 36 | ( 37 | c_custkey UINTEGER, 38 | c_name VARCHAR, 39 | c_address VARCHAR, 40 | c_city VARCHAR, 41 | c_nation VARCHAR, 42 | c_region VARCHAR, 43 | c_phone VARCHAR, 44 | c_mktsegment VARCHAR, 45 | PRIMARY KEY (c_custkey) 46 | ); 47 | 48 | CREATE TABLE date 49 | ( 50 | d_datekey UINTEGER, 51 | d_date VARCHAR, 52 | d_dayofweek VARCHAR, 53 | d_month VARCHAR, 54 | d_year USMALLINT, 55 | d_yearmonthnum UINTEGER, 56 | d_yearmonth VARCHAR, 57 | d_daynuminweek UTINYINT, 58 | d_daynuminmonth UTINYINT, 59 | d_daynuminyear USMALLINT, 60 | d_monthnuminyear UTINYINT, 61 | d_weeknuminyear UTINYINT, 62 | d_sellingseason VARCHAR, 63 | d_lastdayinweekfl BOOLEAN, 64 | d_lastdayinmonthfl BOOLEAN, 65 | d_holidayfl BOOLEAN, 66 | d_weekdayfl BOOLEAN, 67 | PRIMARY KEY (d_datekey) 68 | ); 69 | 70 | CREATE TABLE lineorder 71 | ( 72 | lo_orderkey UINTEGER, 73 | lo_linenumber UTINYINT, 74 | lo_custkey UINTEGER, 75 | lo_partkey UINTEGER, 76 | lo_suppkey UINTEGER, 77 | lo_orderdate UINTEGER, 78 | lo_orderpriority VARCHAR, 79 | lo_shippriority VARCHAR, 80 | lo_quantity UTINYINT, 81 | lo_extendedprice UINTEGER, 82 | lo_ordtotalprice UINTEGER, 83 | lo_discount UTINYINT, 84 | lo_revenue UINTEGER, 85 | lo_supplycost UINTEGER, 86 | lo_tax UTINYINT, 87 | lo_commitdate UINTEGER, 88 | lo_shipmode VARCHAR, 89 | PRIMARY KEY (lo_orderkey, lo_linenumber) 90 | ); 91 | -------------------------------------------------------------------------------- /src/benchmarks/ssb/sql/init/sqlite3.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS lineorder; 2 | DROP TABLE IF EXISTS part; 3 | DROP TABLE IF EXISTS supplier; 4 | DROP TABLE IF EXISTS customer; 5 | DROP TABLE IF EXISTS date; 6 | 7 | CREATE TABLE part 8 | ( 9 | p_partkey INTEGER, 10 | p_name TEXT, 11 | p_mfgr TEXT, 12 | p_category TEXT, 13 | p_brand1 TEXT, 14 | p_color TEXT, 15 | p_type TEXT, 16 | p_size INTEGER, 17 | p_container TEXT, 18 | PRIMARY KEY (p_partkey) 19 | ); 20 | 21 | CREATE TABLE supplier 22 | ( 23 | s_suppkey INTEGER, 24 | s_name TEXT, 25 | s_address TEXT, 26 | s_city TEXT, 27 | s_nation TEXT, 28 | s_region TEXT, 29 | s_phone TEXT, 30 | PRIMARY KEY (s_suppkey) 31 | ); 32 | 33 | CREATE TABLE customer 34 | ( 35 | c_custkey INTEGER, 36 | c_name TEXT, 37 | c_address TEXT, 38 | c_city TEXT, 39 | c_nation TEXT, 40 | c_region TEXT, 41 | c_phone TEXT, 42 | c_mktsegment TEXT, 43 | PRIMARY KEY (c_custkey) 44 | ); 45 | 46 | CREATE TABLE date 47 | ( 48 | d_datekey INTEGER, 49 | d_date TEXT, 50 | d_dayofweek TEXT, 51 | d_month TEXT, 52 | d_year INTEGER, 53 | d_yearmonthnum INTEGER, 54 | d_yearmonth TEXT, 55 | d_daynuminweek INTEGER, 56 | d_daynuminmonth INTEGER, 57 | d_daynuminyear INTEGER, 58 | d_monthnuminyear INTEGER, 59 | d_weeknuminyear INTEGER, 60 | d_sellingseason TEXT, 61 | d_lastdayinweekfl INTEGER, 62 | d_lastdayinmonthfl INTEGER, 63 | d_holidayfl INTEGER, 64 | d_weekdayfl INTEGER, 65 | PRIMARY KEY (d_datekey) 66 | ); 67 | 68 | CREATE TABLE lineorder 69 | ( 70 | lo_orderkey INTEGER, 71 | lo_linenumber INTEGER, 72 | lo_custkey INTEGER, 73 | lo_partkey INTEGER, 74 | lo_suppkey INTEGER, 75 | lo_orderdate INTEGER, 76 | lo_orderpriority TEXT, 77 | lo_shippriority TEXT, 78 | lo_quantity INTEGER, 79 | lo_extendedprice INTEGER, 80 | lo_ordtotalprice INTEGER, 81 | lo_discount INTEGER, 82 | lo_revenue INTEGER, 83 | lo_supplycost INTEGER, 84 | lo_tax INTEGER, 85 | lo_commitdate INTEGER, 86 | lo_shipmode TEXT, 87 | PRIMARY KEY (lo_orderkey, lo_linenumber), 88 | FOREIGN KEY (lo_custkey) REFERENCES customer (c_custkey), 89 | FOREIGN KEY (lo_partkey) REFERENCES part (p_partkey), 90 | FOREIGN KEY (lo_suppkey) REFERENCES supplier (s_suppkey), 91 | FOREIGN KEY (lo_orderdate) REFERENCES date (d_datekey) 92 | ); 93 | 94 | .import part.tbl part 95 | .import supplier.tbl supplier 96 | .import customer.tbl customer 97 | .import date.tbl date 98 | .import lineorder.tbl lineorder 99 | -------------------------------------------------------------------------------- /src/benchmarks/ssb/sql/q1.1.sql: -------------------------------------------------------------------------------- 1 | SELECT SUM(lo_extendedprice * lo_discount) AS revenue 2 | FROM lineorder, date 3 | WHERE lo_orderdate = d_datekey 4 | AND d_year = 1993 5 | AND lo_discount BETWEEN 1 AND 3 6 | AND lo_quantity < 25; 7 | -------------------------------------------------------------------------------- /src/benchmarks/ssb/sql/q1.2.sql: -------------------------------------------------------------------------------- 1 | SELECT SUM(lo_extendedprice * lo_discount) AS revenue 2 | FROM lineorder, date 3 | WHERE lo_orderdate = d_datekey 4 | AND d_yearmonthnum = 199401 5 | AND lo_discount BETWEEN 4 AND 6 6 | AND lo_quantity BETWEEN 26 AND 35; 7 | -------------------------------------------------------------------------------- /src/benchmarks/ssb/sql/q1.3.sql: -------------------------------------------------------------------------------- 1 | SELECT SUM(lo_extendedprice * lo_discount) AS revenue 2 | FROM lineorder, 3 | date 4 | WHERE lo_orderdate = d_datekey 5 | AND d_weeknuminyear = 6 6 | AND d_year = 1994 7 | AND lo_discount BETWEEN 5 AND 7 8 | AND lo_quantity BETWEEN 36 AND 40; 9 | -------------------------------------------------------------------------------- /src/benchmarks/ssb/sql/q2.1.sql: -------------------------------------------------------------------------------- 1 | SELECT SUM(lo_revenue), d_year, p_brand1 2 | FROM lineorder, 3 | date, 4 | part, 5 | supplier 6 | WHERE lo_orderdate = d_datekey 7 | AND lo_partkey = p_partkey 8 | AND lo_suppkey = s_suppkey 9 | AND p_category = 'MFGR#12' 10 | AND s_region = 'AMERICA' 11 | GROUP BY d_year, p_brand1 12 | ORDER BY d_year, p_brand1; 13 | -------------------------------------------------------------------------------- /src/benchmarks/ssb/sql/q2.2.sql: -------------------------------------------------------------------------------- 1 | SELECT SUM(lo_revenue), d_year, p_brand1 2 | FROM lineorder, date, part, supplier 3 | WHERE lo_orderdate = d_datekey 4 | AND lo_partkey = p_partkey 5 | AND lo_suppkey = s_suppkey 6 | AND p_brand1 BETWEEN 'MFGR#2221' AND 'MFGR#2228' 7 | AND s_region = 'ASIA' 8 | GROUP BY d_year, p_brand1 9 | ORDER BY d_year, p_brand1; 10 | -------------------------------------------------------------------------------- /src/benchmarks/ssb/sql/q2.3.sql: -------------------------------------------------------------------------------- 1 | SELECT SUM(lo_revenue), d_year, p_brand1 2 | FROM lineorder, 3 | date, 4 | part, 5 | supplier 6 | WHERE lo_orderdate = d_datekey 7 | AND lo_partkey = p_partkey 8 | AND lo_suppkey = s_suppkey 9 | AND p_brand1 = 'MFGR#2221' 10 | AND s_region = 'EUROPE' 11 | GROUP BY d_year, p_brand1 12 | ORDER BY d_year, p_brand1; 13 | -------------------------------------------------------------------------------- /src/benchmarks/ssb/sql/q3.1.sql: -------------------------------------------------------------------------------- 1 | SELECT c_nation, s_nation, d_year, SUM(lo_revenue) AS revenue 2 | FROM customer, 3 | lineorder, 4 | supplier, 5 | date 6 | WHERE lo_custkey = c_custkey 7 | AND lo_suppkey = s_suppkey 8 | AND lo_orderdate = d_datekey 9 | AND c_region = 'ASIA' 10 | AND s_region = 'ASIA' 11 | AND d_year >= 1992 12 | and d_year <= 1997 13 | GROUP BY c_nation, s_nation, d_year 14 | ORDER BY d_year ASC, revenue DESC; 15 | -------------------------------------------------------------------------------- /src/benchmarks/ssb/sql/q3.2.sql: -------------------------------------------------------------------------------- 1 | SELECT c_city, s_city, d_year, SUM(lo_revenue) AS revenue 2 | FROM customer, 3 | lineorder, 4 | supplier, 5 | date 6 | WHERE lo_custkey = c_custkey 7 | AND lo_suppkey = s_suppkey 8 | AND lo_orderdate = d_datekey 9 | AND c_nation = 'UNITED STATES' 10 | AND s_nation = 'UNITED STATES' 11 | AND d_year >= 1992 12 | and d_year <= 1997 13 | GROUP BY c_city, s_city, d_year 14 | ORDER BY d_year ASC, revenue DESC; 15 | -------------------------------------------------------------------------------- /src/benchmarks/ssb/sql/q3.3.sql: -------------------------------------------------------------------------------- 1 | SELECT c_city, s_city, d_year, SUM(lo_revenue) AS revenue 2 | FROM customer, 3 | lineorder, 4 | supplier, 5 | date 6 | WHERE lo_custkey = c_custkey 7 | AND lo_suppkey = s_suppkey 8 | AND lo_orderdate = d_datekey 9 | AND (c_city = 'UNITED KI1' OR c_city = 'UNITED KI5') 10 | AND (s_city = 'UNITED KI1' OR s_city = 'UNITED KI5') 11 | AND d_year >= 1992 12 | AND d_year <= 1997 13 | GROUP BY c_city, s_city, d_year 14 | ORDER BY d_year ASC, revenue DESC; 15 | -------------------------------------------------------------------------------- /src/benchmarks/ssb/sql/q3.4.sql: -------------------------------------------------------------------------------- 1 | SELECT c_city, s_city, d_year, SUM(lo_revenue) AS revenue 2 | FROM customer, 3 | lineorder, 4 | supplier, 5 | date 6 | WHERE lo_custkey = c_custkey 7 | AND lo_suppkey = s_suppkey 8 | AND lo_orderdate = d_datekey 9 | AND (c_city = 'UNITED KI1' OR c_city = 'UNITED KI5') 10 | AND (s_city = 'UNITED KI1' OR s_city = 'UNITED KI5') 11 | AND d_yearmonth = 'Dec1997' 12 | GROUP BY c_city, s_city, d_year 13 | ORDER BY d_year ASC, revenue DESC; 14 | -------------------------------------------------------------------------------- /src/benchmarks/ssb/sql/q4.1.sql: -------------------------------------------------------------------------------- 1 | SELECT d_year, c_nation, SUM(lo_revenue - lo_supplycost) AS profit 2 | FROM date, 3 | customer, 4 | supplier, 5 | part, 6 | lineorder 7 | WHERE lo_custkey = c_custkey 8 | AND lo_suppkey = s_suppkey 9 | AND lo_partkey = p_partkey 10 | AND lo_orderdate = d_datekey 11 | AND c_region = 'AMERICA' 12 | AND s_region = 'AMERICA' 13 | AND (p_mfgr = 'MFGR#1' OR p_mfgr = 'MFGR#2') 14 | GROUP BY d_year, c_nation 15 | ORDER BY d_year, c_nation; 16 | -------------------------------------------------------------------------------- /src/benchmarks/ssb/sql/q4.2.sql: -------------------------------------------------------------------------------- 1 | SELECT d_year, 2 | s_nation, 3 | p_category, 4 | SUM(lo_revenue - lo_supplycost) AS profit 5 | FROM date, 6 | customer, 7 | supplier, 8 | part, 9 | lineorder 10 | WHERE lo_custkey = c_custkey 11 | AND lo_suppkey = s_suppkey 12 | AND lo_partkey = p_partkey 13 | AND lo_orderdate = d_datekey 14 | AND c_region = 'AMERICA' 15 | AND s_region = 'AMERICA' 16 | AND (d_year = 1997 OR d_year = 1998) 17 | AND (p_mfgr = 'MFGR#1' OR p_mfgr = 'MFGR#2') 18 | GROUP BY d_year, s_nation, p_category 19 | ORDER BY d_year, s_nation, p_category; 20 | -------------------------------------------------------------------------------- /src/benchmarks/ssb/sql/q4.3.sql: -------------------------------------------------------------------------------- 1 | SELECT d_year, 2 | s_city, 3 | p_brand1, 4 | SUM(lo_revenue - lo_supplycost) AS profit 5 | FROM date, 6 | customer, 7 | supplier, 8 | part, 9 | lineorder 10 | WHERE lo_custkey = c_custkey 11 | AND lo_suppkey = s_suppkey 12 | AND lo_partkey = p_partkey 13 | AND lo_orderdate = d_datekey 14 | AND c_region = 'AMERICA' 15 | AND s_nation = 'UNITED STATES' 16 | AND (d_year = 1997 OR d_year = 1998) 17 | AND p_category = 'MFGR#14' 18 | GROUP BY d_year, s_city, p_brand1 19 | ORDER BY d_year, s_city, p_brand1; 20 | -------------------------------------------------------------------------------- /src/benchmarks/ssb/ssb_duckdb.cpp: -------------------------------------------------------------------------------- 1 | #include "cxxopts.hpp" 2 | #include "helpers.hpp" 3 | #include "readfile.hpp" 4 | #include "systems/duckdb/duckdb.hpp" 5 | 6 | void assert_success(const std::unique_ptr &result) { 7 | if (!result->success) { 8 | throw std::runtime_error(result->error); 9 | } 10 | } 11 | 12 | int main(int argc, char **argv) { 13 | cxxopts::Options options = ssb_options("ssb_duckdb", "SSB on DuckDB"); 14 | 15 | cxxopts::OptionAdder adder = options.add_options("DuckDB"); 16 | adder("load", "Load the database"); 17 | adder("run", "Run the benchmark"); 18 | adder("memory_limit", "Memory limit", 19 | cxxopts::value()->default_value("1GB")); 20 | adder("threads", "Number of threads", 21 | cxxopts::value()->default_value("1")); 22 | 23 | cxxopts::ParseResult result = options.parse(argc, argv); 24 | 25 | if (result.count("help")) { 26 | std::cout << options.help(); 27 | return 0; 28 | } 29 | 30 | auto memory_limit = result["memory_limit"].as(); 31 | auto threads = result["threads"].as(); 32 | 33 | duckdb::DuckDB db("ssb.duckdb"); 34 | 35 | if (result.count("load")) { 36 | duckdb::Connection conn(db); 37 | 38 | std::string sql = readfile("sql/init/duckdb.sql"); 39 | assert_success(conn.Query(sql)); 40 | 41 | assert_success(conn.Query("COPY part FROM 'part.tbl' (AUTO_DETECT TRUE)")); 42 | assert_success( 43 | conn.Query("COPY supplier FROM 'supplier.tbl' (AUTO_DETECT TRUE)")); 44 | assert_success( 45 | conn.Query("COPY customer FROM 'customer.tbl' (AUTO_DETECT TRUE)")); 46 | assert_success(conn.Query("COPY date FROM 'date.tbl' (AUTO_DETECT TRUE)")); 47 | assert_success( 48 | conn.Query("COPY lineorder FROM 'lineorder.tbl' (AUTO_DETECT TRUE)")); 49 | } 50 | 51 | if (result.count("run")) { 52 | duckdb::Connection conn(db); 53 | 54 | assert_success(conn.Query("PRAGMA memory_limit='" + memory_limit + "'")); 55 | assert_success(conn.Query("PRAGMA threads=" + threads)); 56 | 57 | assert_success(conn.Query("SELECT * FROM lineorder")); 58 | assert_success(conn.Query("SELECT * FROM part")); 59 | assert_success(conn.Query("SELECT * FROM supplier")); 60 | assert_success(conn.Query("SELECT * FROM customer")); 61 | assert_success(conn.Query("SELECT * FROM date")); 62 | 63 | for (const std::string &query : 64 | {"q1.1", "q1.2", "q1.3", "q2.1", "q2.2", "q2.3", "q3.1", "q3.2", 65 | "q3.3", "q3.4", "q4.1", "q4.2", "q4.3"}) { 66 | std::string sql = readfile("sql/" + query + ".sql"); 67 | std::cout << time([&] { assert_success(conn.Query(sql)); }); 68 | if (query != "q4.3") { 69 | std::cout << "," << std::flush; 70 | } 71 | } 72 | std::cout << std::endl; 73 | } 74 | 75 | return 0; 76 | } 77 | -------------------------------------------------------------------------------- /src/benchmarks/ssb/ssb_sqlite3.cpp: -------------------------------------------------------------------------------- 1 | #include "cxxopts.hpp" 2 | #include "helpers.hpp" 3 | #include "readfile.hpp" 4 | #include "sqlite3.hpp" 5 | 6 | int main(int argc, char **argv) { 7 | cxxopts::Options options = ssb_options("ssb_sqlite3", "SSB on SQLite3"); 8 | 9 | cxxopts::OptionAdder adder = options.add_options("SQLite3"); 10 | adder("bloom_filter", "Use Bloom filters", 11 | cxxopts::value()->default_value("false")); 12 | adder("cache_size", "Cache size", 13 | cxxopts::value()->default_value("-1000000")); 14 | 15 | cxxopts::ParseResult result = options.parse(argc, argv); 16 | 17 | if (result.count("help")) { 18 | std::cout << options.help(); 19 | return 0; 20 | } 21 | 22 | sqlite::Database db("ssb.sqlite"); 23 | 24 | sqlite::Connection conn; 25 | db.connect(conn).expect(SQLITE_OK); 26 | 27 | uint64_t mask = result["bloom_filter"].as() ? 0 : 0x00080000; 28 | int rc = sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS, conn.ptr().get(), 29 | mask); 30 | if (rc != SQLITE_OK) { 31 | throw std::runtime_error(sqlite3_errmsg(conn.ptr().get())); 32 | } 33 | 34 | conn.execute("PRAGMA cache_size=" + result["cache_size"].as()) 35 | .expect(SQLITE_OK); 36 | 37 | conn.execute("ANALYZE").expect(SQLITE_OK); 38 | 39 | conn.execute("SELECT * FROM lineorder").expect(SQLITE_OK); 40 | conn.execute("SELECT * FROM part").expect(SQLITE_OK); 41 | conn.execute("SELECT * FROM supplier").expect(SQLITE_OK); 42 | conn.execute("SELECT * FROM customer").expect(SQLITE_OK); 43 | conn.execute("SELECT * FROM date").expect(SQLITE_OK); 44 | 45 | for (const std::string &query : 46 | {"q1.1", "q1.2", "q1.3", "q2.1", "q2.2", "q2.3", "q3.1", "q3.2", "q3.3", 47 | "q3.4", "q4.1", "q4.2", "q4.3"}) { 48 | std::string sql = readfile("sql/" + query + ".sql"); 49 | std::cout << time([&] { conn.execute(sql).expect(SQLITE_OK); }); 50 | if (query != "q4.3") { 51 | std::cout << "," << std::flush; 52 | } 53 | } 54 | std::cout << std::endl; 55 | 56 | return 0; 57 | } 58 | -------------------------------------------------------------------------------- /src/benchmarks/tatp/helpers.hpp: -------------------------------------------------------------------------------- 1 | #ifndef SQLITE_PERFORMANCE_TATP_HELPERS_HPP 2 | #define SQLITE_PERFORMANCE_TATP_HELPERS_HPP 3 | 4 | #include "cxxopts.hpp" 5 | 6 | #include 7 | 8 | cxxopts::Options tatp_options(const std::string &program, 9 | const std::string &help_string = "") { 10 | cxxopts::Options options(program, help_string); 11 | cxxopts::OptionAdder adder = options.add_options(); 12 | adder("load", "Load the database"); 13 | adder("run", "Run the benchmark"); 14 | adder("records", "Number of subscriber records", 15 | cxxopts::value()->default_value("1000")); 16 | adder("clients", "Number of clients", 17 | cxxopts::value()->default_value("1")); 18 | adder("warmup", "Warmup duration in seconds", 19 | cxxopts::value()->default_value("10")); 20 | adder("measure", "Measure duration in seconds", 21 | cxxopts::value()->default_value("60")); 22 | adder("help", "Print help"); 23 | return options; 24 | } 25 | 26 | std::vector 27 | tatp_create_sql(const std::string &bool_type, const std::string &uint8_type, 28 | const std::string &uint32_type, const std::string &uint64_type, 29 | const std::string &string_type, bool enable_foreign_keys) { 30 | std::vector sql = {"DROP TABLE IF EXISTS call_forwarding", 31 | "DROP TABLE IF EXISTS special_facility", 32 | "DROP TABLE IF EXISTS access_info", 33 | "DROP TABLE IF EXISTS subscriber"}; 34 | 35 | std::ostringstream subscriber; 36 | subscriber << "CREATE TABLE subscriber (" 37 | << "s_id " << uint64_type << ", " 38 | << "sub_nbr " << string_type << " UNIQUE, "; 39 | for (int i = 1; i <= 10; ++i) { 40 | subscriber << "bit_" << i << " " << bool_type << ", "; 41 | } 42 | for (int i = 1; i <= 10; ++i) { 43 | subscriber << "hex_" << i << " " << uint8_type << ", "; 44 | } 45 | for (int i = 1; i <= 10; ++i) { 46 | subscriber << "byte2_" << i << " " << uint8_type << ", "; 47 | } 48 | subscriber << "msc_location " << uint32_type << ", " 49 | << "vlr_location " << uint32_type << ", " 50 | << "PRIMARY KEY (s_id))" << std::endl; 51 | sql.push_back(subscriber.str()); 52 | 53 | std::ostringstream access_info; 54 | access_info << "CREATE TABLE access_info (" 55 | << "s_id " << uint64_type << ", " 56 | << "ai_type " << uint8_type << ", " 57 | << "data1 " << uint8_type << ", " 58 | << "data2 " << uint8_type << ", " 59 | << "data3 " << string_type << ", " 60 | << "data4 " << string_type << ", " 61 | << "PRIMARY KEY (s_id, ai_type)"; 62 | if (enable_foreign_keys) { 63 | access_info << ", FOREIGN KEY (s_id) REFERENCES subscriber (s_id)"; 64 | } 65 | access_info << ")" << std::endl; 66 | sql.push_back(access_info.str()); 67 | 68 | std::ostringstream special_facility; 69 | special_facility << "CREATE TABLE special_facility (" 70 | << "s_id " << uint64_type << ", " 71 | << "sf_type " << uint8_type << ", " 72 | << "is_active " << bool_type << ", " 73 | << "error_cntrl " << uint8_type << ", " 74 | << "data_a " << uint8_type << ", " 75 | << "data_b " << string_type << ", " 76 | << "PRIMARY KEY (s_id, sf_type)"; 77 | if (enable_foreign_keys) { 78 | special_facility << ", FOREIGN KEY (s_id) REFERENCES subscriber (s_id)"; 79 | } 80 | special_facility << ")" << std::endl; 81 | sql.push_back(special_facility.str()); 82 | 83 | std::ostringstream call_forwarding; 84 | call_forwarding << "CREATE TABLE call_forwarding (" 85 | << "s_id " << uint64_type << ", " 86 | << "sf_type " << uint8_type << ", " 87 | << "start_time " << uint8_type << ", " 88 | << "end_time " << uint8_type << ", " 89 | << "numberx " << string_type << ", " 90 | << "PRIMARY KEY (s_id, sf_type, start_time)"; 91 | if (enable_foreign_keys) { 92 | call_forwarding << ", FOREIGN KEY (s_id, sf_type) " 93 | << "REFERENCES special_facility (s_id, sf_type)"; 94 | } 95 | call_forwarding << ")" << std::endl; 96 | sql.push_back(call_forwarding.str()); 97 | 98 | return sql; 99 | } 100 | 101 | std::array tatp_statement_sql() { 102 | return {"SELECT * " 103 | "FROM subscriber " 104 | "WHERE s_id = ?;", 105 | 106 | "SELECT cf.numberx " 107 | "FROM special_facility AS sf, call_forwarding AS cf " 108 | "WHERE sf.s_id = ? AND sf.sf_type = ? AND sf.is_active = 1 " 109 | " AND cf.s_id = sf.s_id AND cf.sf_type = sf.sf_type " 110 | " AND cf.start_time <= ? AND ? < cf.end_time;", 111 | 112 | "SELECT data1, data2, data3, data4 " 113 | "FROM access_info " 114 | "WHERE s_id = ? AND ai_type = ?;", 115 | 116 | "UPDATE subscriber " 117 | "SET bit_1 = ? " 118 | "WHERE s_id = ?;", 119 | 120 | "UPDATE special_facility " 121 | "SET data_a = ? " 122 | "WHERE s_id = ? AND sf_type = ?;", 123 | 124 | "UPDATE subscriber " 125 | "SET vlr_location = ? " 126 | "WHERE sub_nbr = ?;", 127 | 128 | "SELECT s_id " 129 | "FROM subscriber " 130 | "WHERE sub_nbr = ?;", 131 | 132 | "SELECT sf_type " 133 | "FROM special_facility " 134 | "WHERE s_id = ?;", 135 | 136 | "INSERT INTO call_forwarding " 137 | "VALUES (?, ?, ?, ?, ?);", 138 | 139 | "DELETE FROM call_forwarding " 140 | "WHERE s_id = ? AND sf_type = ? AND start_time = ?;"}; 141 | } 142 | 143 | #endif // SQLITE_PERFORMANCE_TATP_HELPERS_HPP 144 | -------------------------------------------------------------------------------- /src/benchmarks/tatp/sql/init/duckdb.sql: -------------------------------------------------------------------------------- 1 | PRAGMA memory_limit = '8GB'; 2 | 3 | DROP TABLE IF EXISTS call_forwarding; 4 | DROP TABLE IF EXISTS special_facility; 5 | DROP TABLE IF EXISTS access_info; 6 | DROP TABLE IF EXISTS subscriber; 7 | 8 | CREATE TABLE subscriber 9 | ( 10 | s_id UINTEGER NOT NULL PRIMARY KEY, 11 | sub_nbr VARCHAR NOT NULL UNIQUE, 12 | bit_1 BOOLEAN, 13 | bit_2 BOOLEAN, 14 | bit_3 BOOLEAN, 15 | bit_4 BOOLEAN, 16 | bit_5 BOOLEAN, 17 | bit_6 BOOLEAN, 18 | bit_7 BOOLEAN, 19 | bit_8 BOOLEAN, 20 | bit_9 BOOLEAN, 21 | bit_10 BOOLEAN, 22 | hex_1 UTINYINT, 23 | hex_2 UTINYINT, 24 | hex_3 UTINYINT, 25 | hex_4 UTINYINT, 26 | hex_5 UTINYINT, 27 | hex_6 UTINYINT, 28 | hex_7 UTINYINT, 29 | hex_8 UTINYINT, 30 | hex_9 UTINYINT, 31 | hex_10 UTINYINT, 32 | byte2_1 UTINYINT, 33 | byte2_2 UTINYINT, 34 | byte2_3 UTINYINT, 35 | byte2_4 UTINYINT, 36 | byte2_5 UTINYINT, 37 | byte2_6 UTINYINT, 38 | byte2_7 UTINYINT, 39 | byte2_8 UTINYINT, 40 | byte2_9 UTINYINT, 41 | byte2_10 UTINYINT, 42 | msc_location UINTEGER, 43 | vlr_location UINTEGER 44 | ); 45 | 46 | CREATE TABLE access_info 47 | ( 48 | s_id UINTEGER NOT NULL, 49 | ai_type UTINYINT NOT NULL, 50 | data1 UTINYINT, 51 | data2 UTINYINT, 52 | data3 VARCHAR, 53 | data4 VARCHAR, 54 | PRIMARY KEY (s_id, ai_type) 55 | ); 56 | 57 | CREATE TABLE special_facility 58 | ( 59 | s_id UINTEGER NOT NULL, 60 | sf_type UTINYINT NOT NULL, 61 | is_active BOOLEAN, 62 | error_cntrl UTINYINT, 63 | data_a UTINYINT, 64 | data_b TEXT, 65 | PRIMARY KEY (s_id, sf_type) 66 | ); 67 | 68 | CREATE TABLE call_forwarding 69 | ( 70 | s_id UINTEGER NOT NULL, 71 | sf_type UTINYINT NOT NULL, 72 | start_time UTINYINT NOT NULL, 73 | end_time UTINYINT, 74 | numberx TEXT, 75 | PRIMARY KEY (s_id, sf_type, start_time) 76 | ); 77 | -------------------------------------------------------------------------------- /src/benchmarks/tatp/sql/init/sqlite3.sql: -------------------------------------------------------------------------------- 1 | PRAGMA journal_mode = WAL; 2 | 3 | DROP TABLE IF EXISTS call_forwarding; 4 | DROP TABLE IF EXISTS special_facility; 5 | DROP TABLE IF EXISTS access_info; 6 | DROP TABLE IF EXISTS subscriber; 7 | 8 | CREATE TABLE subscriber 9 | ( 10 | s_id INTEGER NOT NULL PRIMARY KEY, 11 | sub_nbr TEXT NOT NULL UNIQUE, 12 | bit_1 INTEGER, 13 | bit_2 INTEGER, 14 | bit_3 INTEGER, 15 | bit_4 INTEGER, 16 | bit_5 INTEGER, 17 | bit_6 INTEGER, 18 | bit_7 INTEGER, 19 | bit_8 INTEGER, 20 | bit_9 INTEGER, 21 | bit_10 INTEGER, 22 | hex_1 INTEGER, 23 | hex_2 INTEGER, 24 | hex_3 INTEGER, 25 | hex_4 INTEGER, 26 | hex_5 INTEGER, 27 | hex_6 INTEGER, 28 | hex_7 INTEGER, 29 | hex_8 INTEGER, 30 | hex_9 INTEGER, 31 | hex_10 INTEGER, 32 | byte2_1 INTEGER, 33 | byte2_2 INTEGER, 34 | byte2_3 INTEGER, 35 | byte2_4 INTEGER, 36 | byte2_5 INTEGER, 37 | byte2_6 INTEGER, 38 | byte2_7 INTEGER, 39 | byte2_8 INTEGER, 40 | byte2_9 INTEGER, 41 | byte2_10 INTEGER, 42 | msc_location INTEGER, 43 | vlr_location INTEGER 44 | ); 45 | 46 | CREATE TABLE access_info 47 | ( 48 | s_id INTEGER NOT NULL, 49 | ai_type INTEGER NOT NULL, 50 | data1 INTEGER, 51 | data2 INTEGER, 52 | data3 TEXT, 53 | data4 TEXT, 54 | PRIMARY KEY (s_id, ai_type), 55 | FOREIGN KEY (s_id) REFERENCES subscriber (s_id) 56 | ); 57 | 58 | CREATE TABLE special_facility 59 | ( 60 | s_id INTEGER NOT NULL, 61 | sf_type INTEGER NOT NULL, 62 | is_active INTEGER, 63 | error_cntrl INTEGER, 64 | data_a INTEGER, 65 | data_b TEXT, 66 | PRIMARY KEY (s_id, sf_type), 67 | FOREIGN KEY (s_id) REFERENCES subscriber (s_id) 68 | ); 69 | 70 | CREATE TABLE call_forwarding 71 | ( 72 | s_id INTEGER NOT NULL, 73 | sf_type INTEGER NOT NULL, 74 | start_time INTEGER NOT NULL, 75 | end_time INTEGER, 76 | numberx TEXT, 77 | PRIMARY KEY (s_id, sf_type, start_time), 78 | FOREIGN KEY (s_id, sf_type) 79 | REFERENCES special_facility (s_id, sf_type) 80 | ); 81 | -------------------------------------------------------------------------------- /src/benchmarks/tatp/sql/stmt_0.sql: -------------------------------------------------------------------------------- 1 | SELECT * 2 | FROM subscriber 3 | WHERE s_id = ?; 4 | -------------------------------------------------------------------------------- /src/benchmarks/tatp/sql/stmt_1.sql: -------------------------------------------------------------------------------- 1 | SELECT cf.numberx 2 | FROM special_facility AS sf, 3 | call_forwarding AS cf 4 | WHERE sf.s_id = ? 5 | AND sf.sf_type = ? 6 | AND sf.is_active = 1 7 | AND cf.s_id = sf.s_id 8 | AND cf.sf_type = sf.sf_type 9 | AND cf.start_time <= ? 10 | AND ? < cf.end_time; 11 | -------------------------------------------------------------------------------- /src/benchmarks/tatp/sql/stmt_2.sql: -------------------------------------------------------------------------------- 1 | SELECT data1, data2, data3, data4 2 | FROM access_info 3 | WHERE s_id = ? 4 | AND ai_type = ?; 5 | -------------------------------------------------------------------------------- /src/benchmarks/tatp/sql/stmt_3.sql: -------------------------------------------------------------------------------- 1 | UPDATE subscriber 2 | SET bit_1 = ? 3 | WHERE s_id = ?; 4 | -------------------------------------------------------------------------------- /src/benchmarks/tatp/sql/stmt_4.sql: -------------------------------------------------------------------------------- 1 | UPDATE special_facility 2 | SET data_a = ? 3 | WHERE s_id = ? 4 | AND sf_type = ?; 5 | -------------------------------------------------------------------------------- /src/benchmarks/tatp/sql/stmt_5.sql: -------------------------------------------------------------------------------- 1 | UPDATE subscriber 2 | SET vlr_location = ? 3 | WHERE sub_nbr = ?; 4 | -------------------------------------------------------------------------------- /src/benchmarks/tatp/sql/stmt_6.sql: -------------------------------------------------------------------------------- 1 | SELECT s_id 2 | FROM subscriber 3 | WHERE sub_nbr = ? 4 | -------------------------------------------------------------------------------- /src/benchmarks/tatp/sql/stmt_7.sql: -------------------------------------------------------------------------------- 1 | SELECT sf_type 2 | FROM special_facility 3 | WHERE s_id = ?; 4 | -------------------------------------------------------------------------------- /src/benchmarks/tatp/sql/stmt_8.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO call_forwarding 2 | VALUES (?, ?, ?, ?, ?); 3 | -------------------------------------------------------------------------------- /src/benchmarks/tatp/sql/stmt_9.sql: -------------------------------------------------------------------------------- 1 | DELETE 2 | FROM call_forwarding 3 | WHERE s_id = ? 4 | AND sf_type = ? 5 | AND start_time = ?; 6 | -------------------------------------------------------------------------------- /src/readfile.hpp: -------------------------------------------------------------------------------- 1 | #ifndef SQLITE_PERFORMANCE_READFILE_HPP 2 | #define SQLITE_PERFORMANCE_READFILE_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | std::string readfile(const std::string &filename) { 10 | std::ifstream f(filename); 11 | if (!f.is_open()) { 12 | throw std::runtime_error("could not open file " + filename); 13 | } 14 | std::stringstream s; 15 | s << f.rdbuf(); 16 | return s.str(); 17 | } 18 | 19 | #endif // SQLITE_PERFORMANCE_READFILE_HPP 20 | --------------------------------------------------------------------------------