julianhyde/optiq — pull request #278 by vlsi (2014-05-11 07:44:13+00:00)
Title: Avoid row computation on each accessor call

It turns out accessors for different columns do not share `enumerable.current()` row.
If the enumerable comes from `EnumerableCalcRel`, then `current()` contents is computed from scratch for each accessor even though just a single column is used.

Fix: cache the current value of enumerator. This might keep the row reachable a little bit longer, however I believe no harm is made: the reference is replaced on the next row and it is nullified as cursor is closed.

`ObjectEnumeratorCursor` is left as is (no caching) since its row contains just a single column, thus "multiple invocations from different column accessors" are not expected.