Subject IB_QUERY, POST is taking long time, what am I doing wrong?
Author Chuck Belanger
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;