MySQL Forums
Forum List  »  Optimizer & Parser

Re: Need recommendation regarding IN expression
Posted by: Jay Pipes
Date: February 22, 2006 01:29PM

Much more efficient to do:

SELECT SUM(time_on_page)
FROM page_views p
INNER JOIN selected_registrants s
ON p.registrant_id = s.registrant_id
AND s.report_id = 1569;

There is no GROUP BY since you are returning a single scalar value (the sum of all time spent on the page)

Jay Pipes
Community Relations Manager, North America, MySQL Inc.

Got Cluster? http://www.mysql.com/cluster
Personal: http://jpipes.com

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Need recommendation regarding IN expression
2190
February 22, 2006 01:29PM


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.