I found the reason of my server's slowdown. It was in the procedure I wrote in Firebird.
I defined a structure of Name=value pairs. Let's say its field name is CF.
1=tiger
2=lion
3=leopard
4=elephant
et cetra.
This is stored as TStrings.Text in a BLOB filed, so that I can retrieve directly from my pascal app.
With pre-defined paris, I can save them in one field. But there are "other" responses, which are not pre-defined in the previous pair-list.
So I save them as one record per animal, with code, and caption.
code caption
100001 shark
100002 hyena
....
And I wrote a stored procedure function that retrieves all of them at once,
SELECT CF FROM FixedTable WHERE (cond) INTO :CF;
FOR SELECT code, caption FROM OpenTable WHERE (cond) do BEGIN
:CF = :CF || code || '=' || caption || ';'; -- Delimiter is ; in the pascal TStrings definition
END;
suspend; -- this returns CF as a out-field of this procedure
But this takes long time, as the number of records increase in the OpenTable. Just selecting the records from OpenTable does not take much time.
So, I need to change some procedures, or have to change the structure of FixedTable to one record for each animal.
The slowdown had nothing to do with "connecting to DB".