Subject RE: Question on Firebird Query Caching
Author Edward Mendez
We have Firebird FirebirdCS-2.1.3.18185-0.amd64.rpm
<http://sourceforge.net/projects/firebird/files/firebird-linux-amd64/2.1.3-R
elease/FirebirdCS-2.1.3.18185-0.amd64.rpm/download> running on a CENTOS
Server 5.4 64Bit.





I am doing a select * from a stored procedure and it seems that the first
time I run the Query it take a long time.



SELECT COUNT(*) from ACCUREQ_DESC('DROP','','',-1,-1,1,2,1513,7232)



In certain cases the Sproc takes more than 3 minutes to execute



------ Performance info ------

Prepare time = 141ms

Execute time = 3m 11s 734ms

Avg fetch time = 191,734.00 ms

Current memory = 71,079,872

Max memory = 75,424,656

Memory buffers = 4,096

Reads from disk to cache = 53,213

Writes from cache to disk = 0

Fetches from cache = 1,579,912



If I run the Query again.



------ Performance info ------

Prepare time = 125ms

Execute time = 5s 156ms

Avg fetch time = 5,156.00 ms

Current memory = 71,079,800

Max memory = 75,424,656

Memory buffers = 4,096

Reads from disk to cache = 53,213

Writes from cache to disk = 0

Fetches from cache = 1,579,912





The results come back very quickly, but the statistics remain the same
except for the execute time and the prepare time.



I also tried the following.

1) running the Query ( it took a couple of mins to complete )

2) Ran the Query again, - it returned quickly

3) Exited out if IBEXPERT and shutdown the database using

a. /opt/firebird/bin/gfix -user <username> -password <password> <DB
Alias Name> -shut full -force 0

b. Used gfix to bring DB back online

4) Started IBEXPERT

5) Ran the Query and results came back quick





If there a way to tell if the Query returned previous cached results or not
from the IBEXPERT application?



Thank You,



Ed Mendez





[Non-text portions of this message have been removed]