Subject | RE: [IBO] IB_QUERY, POST is taking long time, what am I doing wrong? |
---|---|
Author | Jason Wharton |
Post date | 2004-09-01T21:56:44Z |
Look at the SQL Trace monitor and see if the time is spent on the server or
in your client code.
Jason Wharton
-----Original Message-----
From: Chuck Belanger [mailto:phytotech@...]
Sent: Tuesday, August 31, 2004 3:56 PM
To: IBObjects Listserve
Subject: [IBO] IB_QUERY, POST is taking long time, what am I doing
wrong?
Hello:
I'm doing the following query to update a node that I'm moving in a tree
and the POST is really slow (about 5 seconds). What am I doing wrong?
Thanks,
Chuck Belanger
Qry := TIB_Query.Create(nil);
IB_Connection := IB_connection1;
IB_Transaction := IB_Transaction1;
RequestLive := true;
with qry do
begin
sql.clear
sql. add : Select ml_id, ml_path, ml_parentid, root_id from
masterlibrary where ml_id = :id; (INDEX ON ML_ID)
parambyname id := <id of record>;
prepare
open
if not eof then
begin
edit;
fieldbyname('ml_path').asString := < a string that looks like
'.3814.345.567.34.' and represents ml_id for each node down the tree to
the item>
fieldbyname('root_id').asInteger := newrootid; (INDEX ON THIS)
fieldbyname('ml_parentid').asInteger := newparentID; (INDEX ON THIS)
post;
end;
in your client code.
Jason Wharton
-----Original Message-----
From: Chuck Belanger [mailto:phytotech@...]
Sent: Tuesday, August 31, 2004 3:56 PM
To: IBObjects Listserve
Subject: [IBO] IB_QUERY, POST is taking long time, what am I doing
wrong?
Hello:
I'm doing the following query to update a node that I'm moving in a tree
and the POST is really slow (about 5 seconds). What am I doing wrong?
Thanks,
Chuck Belanger
Qry := TIB_Query.Create(nil);
IB_Connection := IB_connection1;
IB_Transaction := IB_Transaction1;
RequestLive := true;
with qry do
begin
sql.clear
sql. add : Select ml_id, ml_path, ml_parentid, root_id from
masterlibrary where ml_id = :id; (INDEX ON ML_ID)
parambyname id := <id of record>;
prepare
open
if not eof then
begin
edit;
fieldbyname('ml_path').asString := < a string that looks like
'.3814.345.567.34.' and represents ml_id for each node down the tree to
the item>
fieldbyname('root_id').asInteger := newrootid; (INDEX ON THIS)
fieldbyname('ml_parentid').asInteger := newparentID; (INDEX ON THIS)
post;
end;