Commit 0af85139 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Yet another optimization to avoid GROUP BY. Now filtering is done by Python level.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13658 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent accf2fe6
......@@ -250,9 +250,17 @@ class SQLDict(RAMDict):
to_date = now_date, group_method_id = group_method_id,
order_validation_text = order_validation_text)
#LOG('SQLDict dequeueMessage', 0, 'result = %d' % (len(result)))
path_and_method_id_dict = {}
for line in result:
path = line.path
method_id = line.method_id
# Prevent using the same pair of a path and a method id.
key = (path, method_id)
if key in path_and_method_id_dict:
continue
path_and_method_id_dict[key] = 1
uid_list = activity_tool.SQLDict_readUidList(path = path, method_id = method_id,
processing_node = None, to_date = now_date,
order_validation_text = order_validation_text)
......
......@@ -13,7 +13,7 @@ to_date
to_processing_date
group_method_id
order_validation_text</params>
SELECT <dtml-if group_method_id>DISTINCT</dtml-if> * FROM
SELECT * FROM
message
WHERE
processing <> 1
......@@ -22,10 +22,6 @@ WHERE
<dtml-if to_date>AND date <= <dtml-sqlvar to_date type="datetime"> </dtml-if>
<dtml-if group_method_id>AND group_method_id = <dtml-sqlvar group_method_id type="string"> </dtml-if>
<dtml-if order_validation_text>AND order_validation_text = <dtml-sqlvar order_validation_text type="string"> </dtml-if>
<dtml-if group_method_id>
GROUP BY
path, method_id
</dtml-if>
ORDER BY
priority, date, uid
<dtml-if group_method_id>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment