list files: replace WHEREs with INNER JOIN ON
This commit is contained in:
parent
eb884e0e80
commit
807e0c961d
48
atom
48
atom
@ -983,18 +983,18 @@ removeObsoleteFiles
|
|||||||
# get files
|
# get files
|
||||||
echo '
|
echo '
|
||||||
SELECT COUNT(DISTINCT source_files.filename)
|
SELECT COUNT(DISTINCT source_files.filename)
|
||||||
FROM source_files,
|
FROM source_files
|
||||||
destinations,
|
INNER JOIN destination_files
|
||||||
destination_files,
|
ON destination_files.source_file_id=source_files.id
|
||||||
mime_type_actions,
|
INNER JOIN destinations
|
||||||
tags
|
ON destination_files.destination_id=destinations.id
|
||||||
WHERE destination_files.last_change < source_files.last_change
|
INNER JOIN mime_type_actions
|
||||||
AND destinations.id = destination_files.destination_id
|
ON destinations.id=mime_type_actions.destination_id
|
||||||
AND mime_type_actions.destination_id = destinations.id
|
INNER JOIN tags
|
||||||
AND mime_type_actions.id = source_files.mime_type
|
ON source_files.id=tags.source_file
|
||||||
AND source_files.id = destination_files.source_file_id
|
WHERE mime_type_actions.id = source_files.mime_type
|
||||||
AND source_files.id = tags.source_file
|
AND NOT destination_files.last_change = source_files.last_change
|
||||||
AND tags.last_change < source_files.last_change
|
AND NOT tags.last_change = source_files.last_change
|
||||||
AND mime_type_actions.action = 1;' >&3
|
AND mime_type_actions.action = 1;' >&3
|
||||||
read -u4 filecount
|
read -u4 filecount
|
||||||
echo '
|
echo '
|
||||||
@ -1003,18 +1003,18 @@ echo '
|
|||||||
source_files.last_change,
|
source_files.last_change,
|
||||||
mime_type_actions.mime_text,
|
mime_type_actions.mime_text,
|
||||||
source_files.filename
|
source_files.filename
|
||||||
FROM source_files,
|
FROM source_files
|
||||||
destinations,
|
INNER JOIN destination_files
|
||||||
destination_files,
|
ON destination_files.source_file_id=source_files.id
|
||||||
mime_type_actions,
|
INNER JOIN destinations
|
||||||
tags
|
ON destination_files.destination_id=destinations.id
|
||||||
WHERE destination_files.last_change < source_files.last_change
|
INNER JOIN mime_type_actions
|
||||||
AND destinations.id = destination_files.destination_id
|
ON destinations.id=mime_type_actions.destination_id
|
||||||
AND mime_type_actions.destination_id = destinations.id
|
INNER JOIN tags
|
||||||
AND mime_type_actions.id = source_files.mime_type
|
ON source_files.id=tags.source_file
|
||||||
AND source_files.id = destination_files.source_file_id
|
WHERE mime_type_actions.id = source_files.mime_type
|
||||||
AND source_files.id = tags.source_file
|
AND NOT destination_files.last_change = source_files.last_change
|
||||||
AND tags.last_change < source_files.last_change
|
AND NOT tags.last_change = source_files.last_change
|
||||||
AND mime_type_actions.action = 1;
|
AND mime_type_actions.action = 1;
|
||||||
|
|
||||||
SELECT "AtOM:NoMoreFiles";' >&3
|
SELECT "AtOM:NoMoreFiles";' >&3
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user