0
我想获得一些关于我的数据库的统计信息,我的代码看起来很完美,但是我得到了一个真正的大数据库,并且在尝试运行此脚本后,我终于结束了超时失败不要紧,如果我去掉了一些不必要的行或不行,我仍然得到同样的错误,而且脚本如下:在Power Query中优化查询M
let
Source = Sql.Database("DBTEST","DB_TST",[CreateNavigationProperties=false]),
#"Filtered Rows" = Table.SelectRows(Source , each ([Kind] = "Table")),
#"Added Custom" = Table.AddColumn(#"Filtered Rows", "Profile",
each Table.Profile([Data])),
#"Expanded Profile" = Table.ExpandTableColumn(#"Added Custom" ,
"Profile",
{"Column", "Min", "Max", "Average", "StandardDeviation", "Count",
"NullCount", "DistinctCount"},
{"Column", "Min", "Max", "Average", "StandardDeviation", "Count",
"NullCount", "DistinctCount"})
in
#"Expanded Profile",
#"Entfernte Spalten" = Table.RemoveColumns(Tables_profile,{"Data"}),
#"Gefilterte Zeilen" = Table.SelectRows(#"Entfernte Spalten", each true)
in
#"Gefilterte Zeilen"
在Source步骤中添加CommandTimeout属性是处理此问题的常规方法。您还可以通过右键单击该步骤并检查是否启用View Native Query菜单项来查看哪些步骤将查询折叠到服务器。 –