Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 12963

SQL Server 2014 - ColumnStore index Clustered with Merge Join

$
0
0

Hi All,

I would like to know in SQL Server 2014, the new feature "Clustered Columnstore". I had inserted 9 millions of records in to a clustered columnstore table.

Then i do a merge join query to insert and update to another table. The Merge join query is as below :

MERGE [dbo].[Temp_FactSales] AS TARGET
USING [dbo].[FactSales_9m] AS SOURCE
ON
(
TARGET.SALESID = SOURCE.SALESID
)
WHEN NOT MATCHED BY TARGET
THEN INSERT
(
[listid],
[sellerid],
[buyerid],
[eventid],
[dateid],
[qtysold],
[pricepaid],
[commission],
[saletime]
)
VALUES
(
SOURCE.[listid],
SOURCE.[sellerid],
SOURCE.[buyerid],
SOURCE.[eventid],
SOURCE.[dateid],
SOURCE.[qtysold],
SOURCE.[pricepaid],
SOURCE.[commission],
SOURCE.[saletime]
)
WHEN MATCHED THEN
UPDATE
SET
    TARGET.[listid] = SOURCE.[listid],
TARGET.[sellerid] = SOURCE.[sellerid],
TARGET.[buyerid] = SOURCE.[buyerid],
TARGET.[eventid] = SOURCE.[eventid],
TARGET.[dateid] = SOURCE.[dateid],
TARGET.[qtysold] = SOURCE.[qtysold],
TARGET.[pricepaid] = SOURCE.[pricepaid],
TARGET.[commission] = SOURCE.[commission],
TARGET.[saletime] = SOURCE.[saletime]
;

The total execute time is  about 10 mins. However if i removed the Columnstore index in the table which using normal primary key. Then the execution time is less than 1 mins.  

My question is when using "merge join", is this the behavior for columnstore index ? As from what i read, Columnstore index is great performance in read the data but not doing "Insert, update and Delete"?

Hope anyone can help.

Thanks a lot.


Viewing all articles
Browse latest Browse all 12963

Trending Articles