PSOrvia

Comparison with SQLite

What Base does today compared with SQLite, and how fast it is. Preliminary, and we show the cases where Base is slower.

Preliminary. Base is pre-release. These numbers change with every build. They are a snapshot, not a promise.

Speed

Time per operation as a percentage of SQLite (SQLite = 100%). Below 100% Base is faster, above 100% Base is slower. Each operation is measured twice: by counted processor instructions (steady) and by actual duration.

Case Computing effort (counted processor instructions) Actual duration
Point read by key 72% (28% faster) (Base faster) 87% (13% faster) (Base faster)
Bulk insert 89% (11% faster) (Base faster) 98% (2% faster) (About equal)
Range scan 57% (43% faster) (Base faster) 41% (59% faster) (Base faster)
Update 99% (1% faster) (About equal) 63% (37% faster) (Base faster)
Delete 104% (4% slower) (About equal) 72% (28% faster) (Base faster)
Join 95% (5% faster) (About equal) 55% (45% faster) (Base faster)
Aggregation 67% (33% faster) (Base faster) 30% (70% faster) (Base faster)
Mixed workload of a real application 98% (2% faster) (About equal) –
Similarity search 109% (9% slower) (Base slower) –

SQLite = 100%

Similarity search

The query for the items most similar to a given one (10 000 items, three terms each), run with the command-line tool. Time per query in milliseconds. Counted instructions per query: Base 87.6 million, SQLite 80.4 million.

Here only the computing effort is meaningful.

File size

Size of the database file for the same data as a percentage of SQLite (SQLite = 100%). Fresh: written in one transaction. After VACUUM: both files compacted. Above 100% Base is larger.

Base files are larger than SQLite files for all four data sets. The full-text index trees of the catalog are still in the older, larger form.

Feature comparison

Base column: state of the source repository. SQLite column: the SQLite reference version 3.54.1 used for the tests.

FeaturePSOrvia BaseSQLite
One file, no server Yes Yes
Transactions and crash recovery Yes Yes
Several processes on one file Yes Yes
Checksum on every page read
Optional extension in SQLite
Yes Partly
Strict SQL mode in addition to the SQLite-compatible one
STRICT tables in SQLite
Yes Partly
Views, triggers, common table expressions, window functions Yes Yes
JSON functions
Both with JSONB and the JSON subtype
Yes Yes
Full-text search
Base builds the catalogue index in 27 % and answers its queries in 62 % of the SQLite instruction cost; all four tokenizers, rank/bm25, highlight, snippet
Yes Yes
Vector similarity search
Base has it as a Rust interface
Partly No
Several database files in one connection (ATTACH) Yes Yes
Virtual tables and R*Tree index
Base: rtree and generate_series built in, further modules in Rust; no modules in C
Partly Yes
Built-in encryption
SQLite only through separate extensions
Planned No
Runs in existing SQLite programs without changes
Base offers about 86 % of the calls of the SQLite programming interface in a separate library, including piecewise access to large values and the database as one byte image; no loadable extensions
Yes Yes
User-defined functions, collations and hooks Yes Yes
Interactive command line with dot commands and output modes Yes Yes
Online backup in steps, VACUUM and VACUUM INTO Yes Yes
Language bindings
Rust, C, C++, Python, PHP, Go, JavaScript, Java, C#, Dart and Ruby today; more planned for 1.0
Partly Yes
Documented file format Base 1.0 is frozen, not released
License Apache-2.0 for Base; public domain for SQLite
Maturity Base is pre-release; SQLite is decades old and very widely tested

Method

Notes

Measured values from the benchmark notes of PSOrvia Base (version 78f3cc9). Reproducible with the programs in bench/ of the source repository.