Hi.
Does time of query execution depend on values of these properties?
I have a weird problem. When values of these properties are default (UseMetadata = true, ReadOnly = false) some select takes about 20 s. When I change TZQuery.ReadOnly to true, the same select takes about 200 ms. More, this problem appears only in the case of remote databse. When databse is local value of ReadOnly has no influence on time. Can you explain such behavior?
Have UseMetadata and ReadOnly any relationshi[? Does UseMetadata have an impact on time of query execution?
Regards
TZConnection.UseMetadata & TZQuery.ReadOnly
-
- Platinum Boarder
- Posts: 1960
- Joined: 17.01.2011, 14:17
Re: TZConnection.UseMetadata & TZQuery.ReadOnly
Hello jaco,
that greatly depends on the database you use. I can tell you that for postgres things can get slower when you have readonly = false because in that case the driver sometimes queries additional information from the database to construct the updateable result set. So on a remote database there may be a noteable difference.
There could be another effect too. Using Firebird as an example it might not only be the case that there are more quieries to execute if an updateable dataset has to be constructed but also these datasets might be bigger than the one you requested originally. With Firebird transferring result sets that have a lot of rows (possibly a list of table columns) can take quite some time because it seems that Firebird and possibly also Interbase transfer somethi9n like one row or only a couple of rows per round trip between the server an the client. In a scenario like this asking the database to return one row might be fast. But asking the database to return 1000 rows possibly can take some time because 1000 round trips between the server and the client may be needed and ping times will have more of an impact on this than bandwidth...
These are only two things that I encountered. Depending on the database you use and your setup other things also might have an impact...
With best regards,
Jan
that greatly depends on the database you use. I can tell you that for postgres things can get slower when you have readonly = false because in that case the driver sometimes queries additional information from the database to construct the updateable result set. So on a remote database there may be a noteable difference.
There could be another effect too. Using Firebird as an example it might not only be the case that there are more quieries to execute if an updateable dataset has to be constructed but also these datasets might be bigger than the one you requested originally. With Firebird transferring result sets that have a lot of rows (possibly a list of table columns) can take quite some time because it seems that Firebird and possibly also Interbase transfer somethi9n like one row or only a couple of rows per round trip between the server an the client. In a scenario like this asking the database to return one row might be fast. But asking the database to return 1000 rows possibly can take some time because 1000 round trips between the server and the client may be needed and ping times will have more of an impact on this than bandwidth...
These are only two things that I encountered. Depending on the database you use and your setup other things also might have an impact...
With best regards,
Jan