On 11/03/2014 10:51, Dimitry Sibiryakov wrote: > 11.03.2014 14:04, Adriano dos Santos Fernandes wrote: >> A possible solution may be to separate offset calculation from >> IMessageMetadata. > Quoting one movie, "offsets are not important, only data is important". > Leave offsets > to engine, if it cannot work other way, but save users from them. > User program usually already have data kept in a set of variables. It can > easily > provide pointers to them (as it is done now with SQLDA API). Copying them > somewhere is a > bit harder, but also acceptable. Calculate offsets, allocate buffer and then > copy - a > definite overkill. It isn't "easy to use" kind of API. In all known to me > DBMS APIs a > programmer provide pointers to data to client library. And it is a right > thing from > performance POV: pointers are copied better than memory buffers. > The idea is that if you "select a, b, c", you will need "a", "b" and "c", so makes sense to store them together.
If you want to have them in each place of memory, you may copy them. You say that copy is slow, and it's certainly slow than no-copy, but if you want to access data fragmented in every place of memory, it will be much slower than access everything together. Adriano ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel