Re: [sqlite] faster SELECT time on second run

2006-12-13 Thread Joe Wilson
>From personal experience on Windows and Linux, if your sqlite database is smaller than the amount of available RAM, then sequentially read()ing the database file in 8K or larger chunks (and ignoring the read results) outside of the SQLite API is several times faster than first running a dummy

Re: [sqlite] faster SELECT time on second run

2006-12-13 Thread Jay Sprenkle
On 12/12/06, John Stanton <[EMAIL PROTECTED]> wrote: If you want to get as much as possible of the Sqlite database into physical memory on the computer, read all of it. If you just want to preload the cache and VM so that the first user gets faster response execute a dummy query like one you wou

Re: [sqlite] faster SELECT time on second run

2006-12-12 Thread John Stanton
If you want to get as much as possible of the Sqlite database into physical memory on the computer, read all of it. If you just want to preload the cache and VM so that the first user gets faster response execute a dummy query like one you would expect the first user to run. Since the VM logi

Re: [sqlite] faster SELECT time on second run

2006-12-12 Thread Kees Nuyt
On Mon, 11 Dec 2006 19:50:52 -0600, John Stanton wrote: > Use a Unix read or a Windows API ReadFile and read the whole file > in one call. > Find the size of it using a Unix lseek or > Win32 API GetFileSize call. You will certainly > pull the whole file into VM that way. Would that be wise for

Re: [sqlite] faster SELECT time on second run

2006-12-11 Thread John Stanton
Use a Unix read or a Windows API ReadFile and read the whole file in one call. Find the size of it using a Unix lseek or Win32 API GetFileSize call. You will certainly pull the whole file into VM that way. Jay Sprenkle wrote: On 12/11/06, Dennis Cote <[EMAIL PROTECTED]> wrote: Simply read

Re: [sqlite] faster SELECT time on second run

2006-12-11 Thread Jay Sprenkle
On 12/11/06, Dennis Cote <[EMAIL PROTECTED]> wrote: Simply read the entire file once using fread when you open the database. That will load the entire file in to the OS cache so that when SQLite starts reading the file, the required disk blocks are already in memory. The result is the same fast

Re: [sqlite] faster SELECT time on second run

2006-12-11 Thread bartsmissaert
> using fread Not sure how to do that with my VB wrapper. At work now, so can't see, but will give it a try. RBS > RB Smissaert wrote: >> Can't think of any code for that :) >> >> >> >> >> you could prefetch data if you can predict what users will search for >> ;) >> >> > Actually, you don't nee

Re: [sqlite] faster SELECT time on second run

2006-12-11 Thread Dennis Cote
RB Smissaert wrote: Can't think of any code for that :) you could prefetch data if you can predict what users will search for ;) Actually, you don't need to predict the users actions if your database isn't too large. Simply read the entire file once using fread when you open the da