From: Adriano d. S. F. <adr...@gm...> - 2010-01-15 13:07:22
|
Dmitry Yemanov wrote: > Adriano, > >> When it offers a flexibility (allowing, well, requiring) you to pass a >> output SQLDA in each fetch, it need to parse it and create messages at >> every function call. Seems the reason that Dimitry S. says DSQL queries >> are much slower than BLR ones. >> >> In GDS_DSQL_FETCH, this piece should be slow: >> USHORT blr_length, msg_type, msg_length; >> if (UTLD_parse_sqlda(status,&dasup,&blr_length,&msg_type, >> &msg_length, dialect, sqlda, DASUP_CLAUSE_select)) >> { >> return status[1]; >> } >> >> And in the function start: >> if (!sqlda) >> { >> status_exception::raise(Arg::Gds(isc_dsql_sqlda_err)); >> } >> >> I think we can allow DSQL_FETCH to be called with NULL sqlda when >> DSQL_EXECUTE2 has been called with a non-null out_sqlda. In this case we >> don't need to reparse it at every fetch. > > Perhaps we could also allow DSQL_FETCH to be called with NULL sqlda if > any prior DSQL_FETCH calls were with non-null sqlda. In other words, we > should just cache the most recently used non-null output sqlda and use > it when user specifies null output SQLDA. I agree it would be an useful > improvement. > Also possible. > Another related thing (from memory, so I may be imprecise) could be to > still parse the (non-null) output sqlda but don't recreate the output > message every time. ... > Just compare the current sqlda with the priorly used > one and reuse the last message if sqlda hasn't changed. > I thought on storing the last sqlda value and comparing it with the passed one, and totally skip the UTLD call. It would make applications faster automatically, but there will be a potential problem, if the user pass the same sqlda with something changed. I don't think users are doing that, but is something valid currently. Do you mean the same thing? If not, I didn't understood the "still parse ... but don't recreate ..." part. Adriano |