我遇到由mondrian OLAP服務器生成的查詢問題。它需要很長時間。該查詢如下所示。查詢優化
select "TABLE1"."column0" as "c0" from "FACT_TABLE" as "FACT_TABLE",
"TABLE7" as "TABLE7",
"TABLE6" as "TABLE6",
"TABLE5" as "TABLE5",
"TABLE4" as "TABLE4",
"TABLE4" as "TABLE3",
"TABLE2" as "TABLE2",
"TABLE1" as "TABLE2"
where "FACT_TABLE"."column1" = 'VALUE' and
"FACT_TABLE"."column2" =0 and
"FACT_TABLE"."column3" = 0 and
"TABLE2"."table1Fk" = "TABLE1"."table1Id" and
"TABLE3"."table2Fk" = "TABLE2"."table2Id" and
"TABLE4"."table3Fk" = "TABLE3"."table3Id" and
"TABLE5"."table4Fk" = "TABLE4"."table4Id" and
"TABLE6"."table5Fk" = "TABLE5"."table5Id" and
"TABLE7"."table6Fk" = "TABLE6"."table6Id" and
"FACT_TABLE"."table7Fk" = "TABLE7"."table7Id"
group by "TABLE1"."column0"
order by "TABLE1"."column0" ASC
FACT_TABLE有1.346.000行aprox的。 TABLE7有895行aprox。 TABLE6有445行。 TABLE5有183行。 TABLE4有258行。 TABLE3 = TABLE4。 TABLE2有126行。 TABLE1有29行。
該查詢在生產環境中採用2.00 seg aprox,我真的不知道如何改進查詢性能。
即時通過8GB的RAM。 intel xeon L5420在2.50GHZ。 MSSQL 2005
我會apreciated任何幫助,你可以給我
問題是這個語法不是由我生成的。它由別人稱爲Mondrian生成的是一個OLAP服務器。我只是想知道如何改善這可能創建正確的索引或其他東西 – rfders 2010-06-30 22:05:17