Jump to content

SubQuery seems to hang MySQL


redRemedy

Recommended Posts

Hi!

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.*
FROM
s24_event e, s24_event_participant ep, s24_participant p
WHERE
ep.event = $pEventId
AND e.id = ep.event
AND p.id = ep.participant
[/code]

and I changed it into this:
[code]
SELECT *
FROM s24_participant
WHERE id IN
(
SELECT participant
FROM `s24_event_participant`
WHERE event = $pEventId
)
[/code]


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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.