測試 CUBE 採 ROLAP 下 PA 並發與穩定性。涉及事實表 sales_fact_1997、維度表 time_by_day、CUBE sales。修改內容:刪除原 Time 維度、新建 Time 維度、修改 Sales CUBE。
SELECT TOP 10000 * FROM sales_fact_1997)time_by_dayINSERT INTO time_by_day (time_id, the_date, the_year, month_of_year, quarter, day_of_month)
VALUES ('1101', '1999-10-1', '1999', '10', 'Q4', '1');
INSERT INTO time_by_day (time_id, the_date, the_year, month_of_year, quarter, day_of_month)
SELECT TOP 1 time_id + 1, the_date + 1, YEAR(the_date + 1), MONTH(the_date + 1),
{ fn QUARTER(the_date + 1) }, DAY(the_date + 1)
FROM time_by_day ORDER BY time_id DESC;
DECLARE @MyCounter INT; SET @MyCounter = 0;
WHILE (@MyCounter < 2)
BEGIN
WAITFOR DELAY '00:00:10';
INSERT INTO time_by_day (...) -- 同方式 2 的 SELECT
SET @MyCounter = @MyCounter + 1;
END
DECLARE @MyCounter INT, @the_date DATETIME;
SET @MyCounter = 0; SET @the_date = '1999-1-4';
WHILE (@MyCounter < 200000)
BEGIN
WAITFOR DELAY '00:00:10';
INSERT INTO time_by_day (time_id, the_date) VALUES ('371', @the_date);
SET @the_date = @the_date + 1;
SET @MyCounter = @MyCounter + 1;
END