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菜單項來查看哪些步驟將查詢摺疊到服務器。 –