From: Dmitry Y. <fir...@ya...> - 2010-01-15 09:48:15
|
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. 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. Dmitry |