Jump to content


This topic is now archived and is closed to further replies.


SubQuery seems to hang MySQL

Recommended Posts


I am currently evaluating MySQL version 4.1.21. Until now I have only used versions without the support of SubQueries.

As my first test I was planning to re-make som existing queries into Sub-queries. So I started with the following query:
[code]SELECT p.*
s24_event e, s24_event_participant ep, s24_participant p
ep.event = $pEventId
AND e.id = ep.event
AND p.id = ep.participant

and I changed it into this:
FROM s24_participant
SELECT participant
FROM `s24_event_participant`
WHERE event = $pEventId

I should get the same result from these two queries, right?

The latter one seems to cayse MySQL to stop responding. WHen I ran it through a PHP-script I got the "Too many connections"-error message.

Does anyone have any ideas of what the problem could be?

// Jonas Eriksson

Share this post

Link to post
Share on other sites
Not really sure, though you really should leave it as a join.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.