我遇到了由 mondrian OLAP Server 生成的查询的问题。时间太长了。查询如下所示。
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 行。TABLE7 大约有 895 行。TABLE6 有 445 行。TABLE5 有 183 行。TABLE4 有 258 行。表 3 = 表 4。TABLE2 有 126 行。TABLE1 有 29 行。
该查询在生产环境中占用了 2.00 seg aprox,我真的不知道如何提高查询性能。
我超过 8GB RAM。英特尔至强 L5420 在 2.50GHZ。微软 SQL 2005。
我会感谢你能给我的任何帮助