Would it be any use to you to have a separate process which mmaps the file?
Seems to me that would probably keep all the pages in cache constantly.
I just did a local test on my NFS setup and the file appears to cache just
fine.
Does yours behave differently?
#include <stdio.h>
#include <sqlite3.h>
int main(int argc, char *argv[])
{
sqlite3 *db;
int rc;
if (argc != 2) {
printf("Usage: %s dbfile\n",argv[0]);
return 1;
}
rc = sqlite3_open_v2(argv[1],&db,SQLITE_OPEN_READONLY,NULL);
if (rc != SQLITE_OK) {
puts(sqlite3_errmsg(db));
return 1;
}
rc=sqlite3_exec(db,"select * from t",NULL,NULL,NULL);
if (rc != SQLITE_OK) {
puts(sqlite3_errmsg(db));
return 1;
}
sleep(60);
return 0;
}
I had an 8.7MB database I used this on
vmtouch insert.db
Files: 1
Directories: 0
Resident Pages: 0/2128 0/8M 0%
Elapsed: 0.000394 seconds
./testro insert.db&
[1] 26598
sqlite]$ vmtouch insert.db
Files: 1
Directories: 0
Resident Pages: 2128/2128 8M/8M 100%
Elapsed: 0.000556 seconds
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users