UPDATE TABLE1 t1 SET (t1.bdcdyh,t1.ywh)=(select t2.bdcdyh,t2.ywh from table2 t2 where t1.yxtbh=t2.yxtbh and t2.zddm is not null) where t1.yxtbh in (select t3.yxtbh from table3 t3 where t3.bdcdyh is not null and t3.zddm is not null and t3.ywh is not null and t3.qxdm='123456')
這條陳述句大概有10W的資料量,但是執行3個小時都執行不出來。有大神知道怎么解決嗎,求救!
uj5u.com熱心網友回復:
表關聯有建索引嗎,直接根據查詢條件查詢結果集速度快嗎uj5u.com熱心網友回復:
看下有沒有鎖等待,latch等待。uj5u.com熱心網友回復:
可以嘗試1、對table3的bdcdyh、zddm、ywh,table2的yxtbh、zddm等相關的欄位創建索引;2、對查詢的陳述句增加其他查詢條件進行過濾;3、磁區間多次進行update。uj5u.com熱心網友回復:
陳述句在哪執行的? 丟到server上,最好分段,該建索引的建索引uj5u.com熱心網友回復:
重新檢查一下,會不會打錯了。轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/79504.html
標籤:DB2
下一篇:用mysql資料庫匯入access里面mdb格式的檔案的時候,顯示invalid variant operation匯入不了怎么解決
