我想寫一個查詢,通過MFG/PRO發票表'idh_hist'搜索特定的日期範圍。添加日期條件時,它運行速度非常慢。但是,當我推遲日期條件時,速度非常快。你能否建議在idh_hist上寫出一個查詢條件合理快捷的查詢方法。idh_hist查詢速度很慢,搜索日期爲
以下是我的查詢:
for each idh_hist no-lock where idh_domain = "d0002"
and idh_due_date = TODAY:
/* display code here... */
end.
在此先感謝!
數據庫索引:
Flags Index Name Cnt Field Name
----- --------------------- ---- ---------------------
idh_fsm_type 4 + idh_domain
+ idh_fsm_type
+ idh_nbr
+ idh_line
pu idh_invln 4 + idh_domain
+ idh_inv_nbr
+ idh_nbr
+ idh_line
idh_part 4 + idh_domain
+ idh_part
+ idh_inv_nbr
+ idh_line
u oid_idh_hist 1 + oid_idh_hist
你能和我們分享idh_hist表上的索引定義嗎? –
嗨@MikeFechner,我在這裏添加了索引。謝謝。 –