Small. Fast. Reliable.
Choose any three.
This page is about using in-memory SQLite databases.

The file btree_rb.c attached to this page is a replacement binary-tree layer. It uses "red-black" binary trees. To use it, copy it over the btree.c file in the SQLite source tree and recompile. All tables created will be "in-memory". The filename supplied to sqlite_open is ignored.

The following problems currently exist:

The speedcompare.tcl script is a dodgy modification of DRH's speedcompare.tcl script. You run it using the "tclsqlite" interpreter.

The speed.txt file contains performance stats comparing in-memory with on-disk tables.

If anyone wants to develop this into a proper patch for SQLite and has any questions on how to do this, or if you find any bugs, please post to the SQLite yahoo group.


2003-04-15: The in-memory database is now in the CVS tree, though it is still mostly untested.

2003-05-09: In-memory databases are now a feature of the standard SQLite library. To open an in-memory database, use filename ":memory:".