On 3 Nov 2010, at 8:30am, Ben Harper wrote:

> I know the answer to this question is really "Just try it and see", but I 
> want to gauge whether the idea is sane or not before I spend/waste time on 
> the effort:
> 
> I want to build a custom hash table DB, and to solve the 
> concurrency+durability I need something akin to a WAL, and SQLite's WAL seems 
> like a perfect fit. I've looked into the wal.c/wal.h a bit and from my brief 
> perusal it looks like I could quite easily strap the SQLite WAL onto my 
> custom hash table DB.

Modifying SQL, and taking SQL source code and putting it into your own project, 
are difficult and time-consuming.  As a prototype why not /use/ SQL, storing 
your hash codes in a column ?  Use that as a prototype and see if it's fast 
enough.  If it is, stop there.

If you find calculating your hashes externally proves too clunky, you could 
write a custom function to calculate your hash codes

http://www.sqlite.org/c3ref/create_function.html

, or you could remove the extra column but implement your hash codes as a 
collating sequence:

http://www.sqlite.org/c3ref/create_collation.html

Any of the three above ways to do it gets you all the advantages of the WAL 
code /and/ a SQL engine.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to