Discussion:
Monitoring TSQLQuery: Amazing amount of data sent to server, why?
(too old to reply)
Nando
2008-05-02 16:10:47 UTC
Permalink
Hi all,

I'm debugging a TSQLConnection with TSQLMonitor because querys are running
so slow.

I found that using very simple querys like this;

mySQLQuery.Close;
mySQLQuery.SQL.Text := 'SELECT PlnId, Cod_Cups, PtsGrp, Value FROM MyTable
WHERE PlnId = 5';
mySQLQuery.Prepared := True;
mySQLQuery.Open;

The SQLMonitor file shows so many lines not only the one I already show.

Yes, of course I'm debugging line by line and by the time I execute de
mySQLQuery.Open method I have deleted completely the SQLMonitor file.

Why are sent to server so many ...

INTERBASE - isc_dsql_prepare
INTERBASE - isc_dsql_describe_bind
INTERBASE - SQLDialect = 1
INTERBASE - isc_dsql_execute
INTERBASE - isc_dsql_fetch
INTERBASE - isc_dsql_fetch
INTERBASE - isc_dsql_fetch
INTERBASE - isc_dsql_fetch
INTERBASE - isc_dsql_fetch
INTERBASE - isc_dsql_fetch
INTERBASE - isc_dsql_fetch
INTERBASE - isc_dsql_fetch
INTERBASE - isc_dsql_fetch
INTERBASE - isc_dsql_fetch
INTERBASE - isc_dsql_fetch
INTERBASE - isc_dsql_fetch
INTERBASE - isc_dsql_fetch
INTERBASE - isc_dsql_fetch
INTERBASE - isc_dsql_fetch
INTERBASE - isc_dsql_fetch
INTERBASE - isc_dsql_fetch
INTERBASE - isc_dsql_fetch
INTERBASE - isc_dsql_fetch
INTERBASE - isc_dsql_fetch
INTERBASE - isc_dsql_fetch
INTERBASE - isc_dsql_fetch
INTERBASE - isc_dsql_fetch
INTERBASE - isc_dsql_fetch
INTERBASE - isc_dsql_fetch
INTERBASE - isc_dsql_fetch
INTERBASE - isc_commit_transaction
INTERBASE - isc_dsql_free_statement
INTERBASE - isc_dsql_allocate_statement
INTERBASE - isc_start_transaction

... and many, many other?

Nando.
Bill Todd [TeamB]
2008-05-02 16:14:53 UTC
Permalink
There is one fetch for each row returned by the query.
--
Bill Todd (TeamB)
Nando
2008-05-02 16:53:03 UTC
Permalink
Bill,

Thank you for your answer.
Post by Bill Todd [TeamB]
There is one fetch for each row returned by the query.
Is this normal?
Is there any way to avoid this?
Does this explain slow query performance?

By the way, the mySQLQuery.SQL.Text only returns one single row.

Nando.
Bill Todd [TeamB]
2008-05-02 17:07:30 UTC
Permalink
Is this normal? Is there any way to avoid this?
Yes and no.
Does this explain slow query performance?
It depends on what you mean by "slow query performance". If you mean
the time it takes to execute the query on the server (which is the
commone definition) then the answer is no. If you are including the
time to fetch the data then only if you have a very very slow network.
By the way, the mySQLQuery.SQL.Text only returns one single row.
I assume the dbExpress conmponents also fetche metadata for the result
set.
--
Bill Todd (TeamB)
Loading...