Page History
- 2007-Apr-26 10:41 anonymous
- 2007-Apr-25 08:38 anonymous
- 2007-Apr-16 21:55 anonymous
- 2007-Apr-16 06:43 anonymous
- 2006-Oct-31 15:41 anonymous
- 2006-Sep-09 04:51 anonymous
- 2006-Jun-28 14:29 anonymous
- 2006-Jun-28 05:36 anonymous
- 2006-Jun-28 05:25 anonymous
- 2006-Jun-28 05:22 anonymous
- 2006-Mar-14 00:02 anonymous
- 2006-Mar-14 00:02 anonymous
- 2006-Feb-22 15:07 anonymous
- 2006-Feb-20 15:07 anonymous
- 2006-Jan-08 00:40 anonymous
- 2005-Nov-02 13:02 anonymous
- 2005-Jul-03 18:31 anonymous
- 2005-Mar-26 07:47 anonymous
- 2005-Mar-25 15:03 anonymous
- 2004-Sep-12 10:21 anonymous
- 2004-Aug-08 00:47 anonymous
- 2004-Apr-14 04:51 anonymous
- 2004-Apr-14 04:50 anonymous
- 2003-Oct-22 01:18 anonymous
- 2003-Oct-21 19:44 anonymous
- 2003-Oct-21 19:23 anonymous
- 2003-Sep-29 07:03 anonymous
- 2003-Jul-06 21:57 drh
- 2003-May-10 03:20 anonymous
- 2003-Apr-16 14:21 drh
- 2003-Apr-16 13:50 anonymous
- 2003-Feb-05 02:03 anonymous
- 2003-Feb-04 23:27 anonymous
- 2003-Feb-04 23:23 anonymous
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:
- Virtually no testing done. All of the SQLite test suite that is practical to run with in-memory tables succeeds however.
- No memory-leak testing has been done.
- In some queries (ie. to process ORDER BY clauses and some sub-selects), SQLite uses binary-trees to hold intermediate data. The btree layer should not bother to store rollback information in these cases (but it currently does).
- It's a compile time thing. It would be better if you could choose to create tables in-memory at run-time.
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:".