I'm looking for any ideas to the results I'm getting from columnstore indexes in SP1. Both should be impossible, but having them happen pretty much blows that out of the water. This is a completely isolated system. No other connections
or queries being run.
Machine 1:
Virtual Machine - VMWare
Windows Server 2012 Enterprise
SQL Server 2012 Developer SP1
2 processors
2GB RAM - SQL Server has 1.5 GB allocated
Machine 2:
32 bit Windows 7
SQL Server 2012 Developer SP1
4 logical processors - dual core with hyper threading
4GB RAM - SQL Server has 1.5GB allocated
Test Script:
IFNOTEXISTS(SELECT 1
FROMsys.tablesWHERESCHEMA_NAME(schema_id)='dbo'
ANDname='Test')
BEGIN
CREATE
TABLEdbo.Test
(TestIDINTIDENTITY(1,1),
StateProvinceID
INTNOTNULL,
OrderAmount MONEY NOTNULL,
CONSTRAINT
pk_TestPRIMARYKEY(TestID));
END
ELSE
BEGIN
DROP
TABLEdbo.Test
(TestIDINTIDENTITY(1,1),
StateProvinceID INTNOTNULL,
OrderAmount MONEY NOTNULL,
CONSTRAINT pk_TestPRIMARYKEY(TestID));
END;
WITH
Temp_CTE(RowNum)
AS
(SELECTTOP 10000000 ROW_NUMBER()OVER (ORDERBY (SELECTNULL))
FROM
sys.all_columnsaCROSS
JOINsys.all_columnsb
CROSS
JOINsys.all_columnsc)
INSERT
INTOdbo.Test
(StateProvinceID,OrderAmount)
SELECT
NTILE(51)
OVER (ORDERBYRowNum),(RowNum
* 5.0)/
NTILE(51)
OVER (ORDERBYRowNum)
FROM
Temp_CTE;
CREATE
NONCLUSTEREDCOLUMNSTORE
INDEXics_Address
ON
dbo.Test
(StateProvinceID);
GO
SELECT
COUNT(DISTINCTStateProvinceID)
FROM
dbo.Test;
--DROP TABLE dbo.Test;
Problem 1:
Msg 701,Level 17,
State 128,Line 1
There
isinsufficientsystemmemoryin
resourcepool'default'torun
thisquery.
I've modified the default resource pool on the 32 bit machine to 100%, but the 64 bit machine was left at the default 25%. The columnstore index builds just fine with these 10 million rows on machine 1 (64 bit virtual machine), but fails with this 701 error on machine 2 (32 bit Windows 7). I'm building a columnstore index across 38 MB of data on an instance with 1.5GB of memory allocated. SQL Server has the same amount of memory available on both machines, but it runs out of memory on the 32 bit machine. That makes no sense. The 32 bit machine does have 2 more logical processors available to it, but the SQL Server memory available is more than 40 times the size of the data needing to be built into a columnstore index. Yes, I know that the memory required to build a columnstore index is a function of the number of columns and the MAXDOP. Even when I cut the number of processors available to the 32 bit machine to 2 so that it matches the processor availability of the 64 bit machine, I still get the 701 error. I can cut the memory available to SQL Server on the 64 bit machine by 75% and the columnstore index still successfully creates. So, I'm at a complete loss here.
Problem 2:
When I cut the number of rows in the table from 10 million to 1 million, I can get the columnstore index to create. BUT, the count(distinct StateProvinceID) does not produce a consistent query plan. I purposely set this test up so that it sits right
in the value proposition for columnstore indexes, so I should be getting maximum effect. SQL Server should be using the columnstore index AND it should be running in batch mode. Machine 2 (32 bit Windows 7) runs in batch mode. Machine 1 (64
bit Windows Server) runs in row mode. It is the same size data set (1 million rows in the table on both machines). It is precisely the same data set, not a single value is different across any of the 1 million rows. It has a very high duplication
rate and the query is computing an aggregate. I even scaled the data set on the 64 bit Windows Server machine to 500 million rows and still can't get it to run in batch mode.
Mike Hotek mhotek@mssqlserver.com