It's your MySQL client that's run out of memory, not the server. I don't know how many rows MySQL is trying to return. Probably an
enormous amount since you're not sepcifying a join criteria on the data table. The number of records in the event table between
'2006-05-01' AND '2006-05-15' times
The JOIN criteria was there: 'event.cid=data.cid'
His query was fine: Select event.cid, event.timestamp from event, data
Where ( event.timestamp between '2006-05-01' AND '2006-05-15' ) and
event.cid=data.cid;
It may be rewritten into:
SELECT event.cid, event.timestamp
FROM event JOIN data ON
Gabriel PREDA wrote:
The JOIN criteria was there: 'event.cid=data.cid'
It was not there in the upper example he gave where he stated the problem.
It was there in the later query he said he also tried.
His query was fine: Select event.cid, event.timestamp from event, data
Where (
When I try to retrieve all rows in the event table that are in a
particular range and then
try to determine if the cid is in the data table the join takes
forever.
So I tried just tried adding the table to see if the where clause was
slowing things down. Below is a portion on my session.