MySQL Forums
Forum List  »  Performance

Re: Optimization for complicated query
Posted by: Paulo Torrens
Date: August 02, 2012 03:18AM

The inner-joined version was almost right. I had to make some changes, but this one did the trick:


SELECT
camera.id,
camera.host,
camera.port,
camera.name,
AES_DECRYPT(camera.pass, "$secret"),
cameramodel.stream,
model.id
FROM
camera
INNER JOIN user ON
camera.user = user.id
INNER JOIN cameramodel ON
camera.model = cameramodel.id
INNER JOIN model ON
cameramodel.model = model.id
INNER JOIN account ON
account.user = user.id
WHERE
account.access_lvl >= camera.access_lvl
AND
account.security_key = $MY_SECURITY_KEY
AND
account.id = $MY_ACCOUNT_ID;





Here is the outputs asked: http://pastebin.com/qmCweY0i




Thank you very much!

Options: ReplyQuote


Subject
Views
Written By
Posted
1812
August 01, 2012 11:34AM
1000
August 02, 2012 02:17AM
Re: Optimization for complicated query
1071
August 02, 2012 03:18AM
1004
August 02, 2012 11:10AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.