Commit 3f6f07d1 authored by Mame Coumba Sall's avatar Mame Coumba Sall

Optimize methods by rewriting subqueries

parent 671a83f6
......@@ -86,7 +86,7 @@ FROM\n
AND <dtml-var "query[\'where_expression\']">\n
</dtml-if>\n
AND\n
MATCH(SearchableText) AGAINST(<dtml-sqlvar reference type=string>)\n
MATCH(SearchableText) AGAINST(<dtml-let reference="\'%s\' % reference"><dtml-sqlvar reference type=string></dtml-let> IN BOOLEAN MODE)\n
AND\n
<dtml-sqltest reference op=ne type=string>\n
ORDER BY reference, language_order DESC, version DESC, revision DESC\n
......
......@@ -64,8 +64,8 @@ SELECT path, uid\n
FROM\n
(\n
SELECT DISTINCT\n
path,\n
(select uid from catalog where catalog.path=sub.path) as uid\n
sub.path,\n
uid\n
FROM\n
( SELECT\n
@current_path:=IF(@current_reference = reference, @current_path, path) AS path,\n
......@@ -93,7 +93,7 @@ FROM\n
ORDER BY reference, language_order DESC, version DESC, revision DESC\n
) AS innersub\n
)\n
AS sub\n
AS sub inner join catalog on catalog.path = sub.path\n
)\n
AS main\n
WHERE\n
......
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