V4RB - 8.6, 9.22 Initial Query Slowdown

Fitzbew at aol.com Fitzbew at aol.com
Fri Jun 20 16:20:30 CDT 2003


In a message dated 6/20/2003 2:26:22 PM Eastern Daylight Time, 
sunshine at public.kherson.ua writes:

<< on 6/20/03 19:37, Fitzbew at aol.com at Fitzbew at aol.com wrote:
 
 > The first time I run a complex query with my app in OS 8.6 and 9.2.2 (both
 > carbon and Classic compilations), the process takes 9-10 clock seconds.
 
 > Running the same query again, immediately afterward, takes just a second or
 > so.  
 
 > I can close my app, and relaunch it and then run the exact same query ---
 > it takes just a second or so.
 
 This is because on the first run Valentina will built needed indexes.
 
 > If I restart the Mac, and then relaunch the
 > application and run the same query --- it takes 9-10 seconds again the 
first
 > time.  
 
 Aha, then this is not indexes.
 Looks to be caching of db files into your cache.
 
 > ALL subsequent queries are blazing fast.  Just the first one after each
 > restart is slow.  The app runs many queries during launch, but none are
 > complicated (no joins, etc..).  Happens with the machine's virtual memory 
on
 > and off.
 
 
 > The "process" involved just posts recordset contents to a grid --- I've 
ruled
 > out the grid as the cause.
 > 
 > This db file was initially created using mode 1 (just one file).
 > 
 > I assume this is some kind of cache-building issue --- any suggestions as 
to
 > how I can make the initial query run as fast as subsequent queries?  I've
 > experimented with increasing the cache size in ValentinaInit, but it hasn't
 > helped so far.  
 > 
 > (Why doesn't this happen in OS X ?)
 > 
 > Hardware is DP 800 with 384 megabytes of RAM.  Lots of free hard drive 
space.
 
 For OS X you have fast speed and for first query?!
 
 Hmm, something strange.
 If this is reading of data into cache, then both OS 9 and OS X should take
 comparable time...
 
 May be you have too big Valentina cache?
 Try just 5-7 MB. >>

Ruslan (and others),

I've experimented with cache sizes from 1 meg up to 300+ meg --- does not 
affect the main problem of the "slow first query after restart". Yes, I 
re-checked and this only happens in 8.9 and 9.2.2 -- not OS X.

I have discovered that the slowdown is when I am calling NextRecord --- the 
first time cycling through the recordset is slow.  Building the recordset is 
(as always) very fast.  Still, like I said earlier, my app runs many simple 
queries at launch and calls NextRecord.  The recordset I am testing with is only 
around 200 records.  I subsequently build the exact same recordset and 
NextRecord cycles through it very quickly.  It is a very complex recordset, though -- 
many joins.

The database is encrypted, if that might be a factor. 

Would calling NextRecord on a complex query require Valentina to do something 
for the first such query in a session but not for later queries? And only in 
Classic?  

This has me puzzled.

Russ


More information about the Valentina mailing list