On Sun, 18 Oct 2009 17:37:57 +0200, Ron Arts <r...@arts-betel.org> wrote:
>Very true Simon, > >this has been the fastest way so far and I can do around >350000 selects/second this way, using prepared statements >(on my machine at least), but I need more speed. > >That's why I want to skip the SQL processing entirely >and write a C function that reaches directly into the >internal memory structures to gets my record from there. You will have to implement BTree code to walk the index pages. You'll have a hard time to make your code more efficient than the SQLite BTree code. Luckily the BTree code and the Virtual machine interpreter are in the SQLite source repository, which is public domain. EXPLAIN SELECT colX FROM tableY WHERE tableY.id = your key; yields the VM instructions. So, yes, you can do it. Note: the SQLite BTree code may change without notice, because it isn't a public API. In your case I'd either go for a hash table, without SQL, or solve the speed problem with hardware. >thanks, >Ron -- ( Kees Nuyt ) c[_] _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users