MySQL Forums
Forum List  »  Performance

Re: Index suggestion needed for performance improvement
Posted by: Ronald Brown
Date: October 03, 2015 12:14AM

Rick James Wrote:
-------------------------------------------------------
> * Use VARCHAR, not CHAR, unless the string is
> really fixed length.
>
> * Remove LEFT, it seems to be irrelevant.

you mean something like this

UPDATE users u,( SELECT count(content.record_num) as pdfs_uploaded_count, content.uploader as uploader
FROM users, content
WHERE content.anonymous = 0
AND content.uploader != 0
AND users.record_num = content.uploader
GROUP BY users.record_num) as s
SET u.pdfs_uploaded = s.pdfs_uploaded_count
WHERE u.record_num = s.uploader

If i use count(*) , how would mysql know which table to get count from ?

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Index suggestion needed for performance improvement
785
October 03, 2015 12:14AM


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.