MySQL Forums
Forum List  »  Newbie

Re: Group-wise Maximum performance
Posted by: Felix Geerinckx
Date: May 03, 2005 04:31PM

Jon Richards wrote:

> Well it seemed to speed up a little, but not that much.
> I'm using a BIGINT because the value equates to a java 64 bit long. Is there something more
> approporate I should use? the number is basically ms since 1970.


I was intrigued by this problem and did some testing myself (comparing with max-concat).
You should definitely try:


SELECT
SUBSTRING(MAX(CONCAT(LPAD(time, 20, '0'), data)), 21)
FROM d
GROUP BY name

(which is supposed to be very inefficient ;-)

--
felix

Options: ReplyQuote




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.