Subject Re: How to gat a good performance
Author donoteatcarrot

Thanks for everybody's help.
Last night, I got a reseaonable performance by following your
advices and some knowledge from internet.

I do not know so much about Firebird, but would like to share
how my problem was sloved. :->

1. gfix -buffers 50000 c:\test.fdb
I do not know what the "-buffers" exactly means.
but after i tried to set this value from 5000 to 50000,
I found that the first execution after restarting PC only costs
less than 20 seconds.
And about 300MB memory was used by "fbserver.exe" when "c:\test.fdb"
was connected.(before, it was 18MB)

2. create desc index IX_test on table_X (field_B, field_A)
This can gain almost 50% benifit on performance.
Now, to execute the query
select max(field_A), field_B from table_X group by field_B
will only costs 3,4 seconds on my machine.

But why Firebird do not use a index when there are aggregate
functions in query ?
And after the second execution, it will alway takes 3,4 seconds to
return a result.
It seems that there no cache for the results.
How to let Firebird cache the result ?