Skip to content

Instantly share code, notes, and snippets.

@PhilETaylor
Created June 20, 2019 12:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PhilETaylor/630aa27c8e72fb877e033cb6fccda53b to your computer and use it in GitHub Desktop.
Save PhilETaylor/630aa27c8e72fb877e033cb6fccda53b to your computer and use it in GitHub Desktop.
myJoomla Speedup SQL
UPDATE bf_files AS NEWTABLE
INNER JOIN (
SELECT
bf_files_last.filewithpath, bf_files_last.suspectcontent, bf_files_last.falsepositive, bf_files_last.encrypted FROM bf_files_last
LEFT JOIN
bf_files ON bf_files_last.filewithpath = bf_files.filewithpath
WHERE
bf_files_last.currenthash = bf_files.currenthash
AND
bf_files_last.filemtime = bf_files.filemtime
AND
bf_files_last.fileperms = bf_files.fileperms
AND
bf_files_last.filewithpath = bf_files.filewithpath
) AS
OLDTABLE
ON
NEWTABLE.filewithpath = OLDTABLE.filewithpath
SET
NEWTABLE.filewithpath = OLDTABLE.filewithpath,
NEWTABLE.suspectcontent = OLDTABLE.suspectcontent,
NEWTABLE.falsepositive = OLDTABLE.falsepositive,
NEWTABLE.encrypted = OLDTABLE.encrypted,
NEWTABLE.queued = 0
WHERE
OLDTABLE.suspectcontent != 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment