24.02.2017 2:41, Leyne, Sean wrote:
>
>>> These connections perform only a few heavy weight SQL statements
>> (taking max 3-4 of real execution time).
>>  > Most of the time is spent in the Firebird engine waiting for the next 
>> fetch,
>> due to network latencies.
>>
>>    In the engine ?
>
> Yes, the engine would be **waiting** for the next fetch request from the 
> client.

   Engine never waits for the client ! This is against client-server 
architecture.

>> Probably you want to say in the application\client ? Also it is
>> very interesting how do you evaluate that numbers.
>
> Consider:
> - Timeout set to 10 minutes
> - a SELECT, which when tested using local IBExpert,  that takes 1 minutes to 
> execute and return a result set of 10,000 rows
> - the real client application which takes 0.2 seconds per row to perform some 
> required operation.
>
> Based on your logic, the SELECT would be killed after 10 minutes, with only 
> 3,000 rows having been processed by the client application.
>
> Following my logic, any time waiting for a "fetch" would not count, and thus 
> all 10,000 rows would be processed --
 > but the transaction/connection would be 'active' for 33 minutes.

   Following *logic* developer should set timeout based on application 
processing time
or (much better) fetch whole resultset, *commit* ASAP, and then process data.
You describe very bad application (sorry) which holds open transaction 33 times 
longer
than necessary.

>>    The main question is - do you need such benefit at all, and, if so, how 
>> much
>> efforts you are willing to spend on it ?
>
> Yes, 'cus for me the true cost of a statement is not elapsed time but 
> "working time".
>
> Sitting waiting doesn't cost anything.

   Wrong. It costs memory and creates long runnig transactions at least.

>>    If you insist on changes in implementation, please, specify exactly what 
>> you
>> need and where it is implemented in a such way.
>
> Add logic to stop and start the timer in locations where the server is waiting
 > for client requests/"fetch" operations.

   No, sorry, without me. This is against my feeling of common sence and against
all my experience. I could agree to completely exclude fetches from timeout 
scope,
i.e. stop timer right after execute()\open(), but i'm not sure it is correct 
way.

> Where else is it implemented?
>
> I really don't know anywhere, however:

   Because it is not exists.

> 1- I don't know of any other engines which allow for results to be fetched in 
> "pages".
 > It is the fact that the results can be fetch in "pages" with Firebird that, 
 > IMO, raises
 > the need for the additional level of 'accounting'.

   I see no relation of batch fetches (if you speak about it) with all said 
above.

> 2- my review of the MS SQL and Oracle documentation, all I found was about 
> how the client
 > could be configured to stop execution, not to have the server stop an 
 > operation itself.

   MSSQL implements timeouts at client side:

https://blogs.msdn.microsoft.com/khen1234/2005/10/20/theres-no-such-thing-as-a-query-timeout/
https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.commandtimeout(v=vs.110).aspx

   I already described this approach and show why server side timeouts was 
choosen instead.


   Server-side statement timeouts implemented in MySQL:

https://dev.mysql.com/worklog/task/?id=6936 :

   "If SELECT statement execution is completed before the timer expires then we 
cancel the timer"

http://mysqlserverteam.com/server-side-select-statement-timeouts/ :

   "timer is cancelled if the SELECT statement completes within the time limit 
that was set"

i interpret "statement execution is completed" above as "full fetch is done".


   PostgreSQL docs is very limited:

https://www.postgresql.org/docs/9.9/static/runtime-config-client.html

see "statement_timeout"


   I found no docs re. statement timeouts in Oracle



Regards,
Vlad

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to