MySQL Forums
Forum List  »  Partitioning

Re: Partitioning and JOIN
Posted by: Rick James
Date: November 06, 2009 08:26PM

I see nothing to tell it how to prune the second table. Is are the 'created' columns the same for each match? If so, then this might work:

select  count(*)
    from  session as s
        left join  action as a on s.id = a.session_id
    where  s.created >= '2007-03-01'
      and  s.created <= '2007-03-31 23:59:59'
      and  a.created >= '2007-03-01'
      and  a.created <= '2007-03-31 23:59:59'

Isn't the pruning field (created) supposed to be part of the PRIMARY KEY?

Options: ReplyQuote


Subject
Views
Written By
Posted
7469
m z
November 05, 2009 02:07PM
3270
m z
November 06, 2009 11:15AM
Re: Partitioning and JOIN
3006
November 06, 2009 08:26PM


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.