【发布时间】:2020-10-19 11:36:21
【问题描述】:
我必须快速访问包含唯一索引 mstr_nbr 的大量数据的数据库,如何才能快速访问。 其中第一个 mstr 占用 0ms 并获取下一个 mstr 大部分时间需要 0 毫秒,但有时需要 1 毫秒 意味着每个 mstr 运行 180000 次运行 12000 次运行需要 1 毫秒,这会增加时间,如果串行循环每次增加 12000 毫秒秒也不会增加,这是一个 webspeed 生成的网页,我怎样才能让它快速......任何人都可以帮助
DEFINE QUERY Mstr FOR mstr scrolling.
OPEN QUERY Mstr FOR EACH mstr no-lock
where (Mstr_status = "close" or Mstr_status = "closed").
FOR EACH serial
WHERE (serial_pallet = f_pallet AND serial_f_chr11 <> "BOX")
or (serial_key begins f_pallet)
NO-LOCK BREAK BY serial_pallet by serial_parent by serial__chr11 QUERY-TUNING(LOOKAHEAD CACHE-SIZE 32768 DEBUG EXTENDED):
GET FIRST Mstr.
define variable roID as rowid no-undo.
roID = rowid(mstr).
DO WHILE NOT QUERY-OFF-END('Mstr'):
for each det fields(detnbr detmodel detlot detqty) no-lock
where (detnbr = mstr_nbr) and (detmodel = serial_parent and detlot = serial__chr11):
tinspected = tinspected + detqty.
end. /* for each */
GET NEXT Mstr.
END.
reposition mstr to rowid roID.
end.
mstr 表的索引
index-name field-name
badgenew 1 badgenew Active
datenew 1 datenew Active
nbridx 1 nbr Unique Primary Active
pallet 1 pallet Active
proddesc 1 proddesc Active
prodline 1 prodline Active
status 1 status Active
type 1 type Active
表序列的索引:
actual_prod_day 1 dte04 2 serial_chr01 Active
actual_prod_line 1 serial_pallet 2 serial_dte04 3 serial_chr01 4 serial_line Active
pallet_prod 1 serial_pallet 2 serial_dte04 Active
pallet_prod_line 1 serial_pallet 2 serial_dte04 3 serial_line Active
serial_chr01 1 serial_chr01 Active
serial_chr05 1 serial_chr05 Active
serial_chr06 1 serial_chr06 Active
serial_chr11 1 serial_chr11 Active
serial_chr14 1 serial_chr14 Active
serial_dte04 1 serial_dte04 Active
serial_int01 1 serial_int01 Active
serial_line 1 serial_line Active
serial_pallet 1 serial_pallet Active
serial_parent 1 serial_parent Active
serial_serial__key 1 serial_serial__key 2 serial_parent Unique Primary Active
serial_pallet serial_key和serial_c11都是字符数据类型
表 det 的索引:
detidx 1 detnbr 2 detpallet 3 detprodline 4 detbox 5 detlot 6 detshift Unique Primary Active
detlot 1 detlot Active
detmodel 1 detmodel Active
detnbr 1 detnbr Active
detpallet 1 detpallet Active
detprodline 1 detprodline Active
【问题讨论】:
-
“我怎样才能让它更快” - 通过放弃进度?这是一个旧世界的 4GL 系统,现已停产。
-
不过更重要的是 - 在数据字典工具中检查您的索引。您使用的是哪个版本的 Progress?
-
您必须为此使用 Progress 的 4GL 吗?您是否考虑过使用 Progress 的 SQL 引擎?
-
progress ver 11 是的,我必须使用,因为我为一个需要进步的项目工作
-
进展并未“停止”。它活得很好。
标签: openedge progress-4gl progress-db webspeed