Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Batch mode in SQL Server column store index

$
0
0

Im trying to learn how to use the column store index, and my problem is that i cant get my queries to run in batch mode, i have followed the tutorial by Eric Hanson but it just wont work! I created a column store index on almost all my columns in the fact table( at least the ones that are used in the query) but in the execution plan i can see that its running in row mode, no matter what i do.. i changed max degree of parallelism to 0.

i tried this:

WITH countByDate(_created_, c) AS(
SELECT _created_, count(*)
FROM dbo.fact_order
GROUP BY _created_)

SELECT sum(c)
FROM countByDate

And this:

WITH T (dim_facilities_dkey, antal) AS(
SELECT f.dim_facilities_dkey, COUNT(d.company)antal
FROM dbo.fact_orderstatus f
JOIN dbo.dim_divisions d on f.dim_divisions_dkey= d.dim_divisions_dkey
GROUP BY f.Dim_Facilities_dKey
)

SELECT  f.dim_facilities_dkey,
SUM (ISNULL (T.antal, 0)) as antal
FROM dbo.fact_orderstatus f
LEFT OUTER JOIN T on f.dim_facilities_dkey = T.dim_facilities_dkey
group by f.dim_facilities_dkey 
order by SUM(ISNULL(T.antal,0)) desc;

I would really appreciate if someone can give me an advice on what im doing wrong, 

thanks in advance!


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>