While testing the clustered columnstore indexes in SS2014 CTP1, I found the following strange behavior: a SELECT statement accessing several clustered columnstore indexes that uses batch mode if used by itself switches completely to row mode as soon as I insert it into a table variable:
SELECT <complex logic accessing CS indexes>
uses batch mode, while the same select statement, if used in the following context uses row mode:
BEGIN
DECLARE @a as table(...);
INSERT into @a SELECT <complex logic accessing CS indexes>;
END
Inserting into a temp table instead of a table variable keeps using batch mode.
Can I assume this will be fixed in the final version?