List:Internals« Previous MessageNext Message »
From:Sergei Golubchik Date:August 1 2009 5:08pm
Subject:Re: why does UNION ALL use a temp table?
View as plain text  

On Aug 01, MARK CALLAGHAN wrote:
> Why does UNION ALL always use a temp table?  It would be more
> efficient to send the result from each branch of a UNION ALL directly
> to the network rather than buffering it in a temp table first until
> all branches have been evaluated. Some apps use UNION ALL to improve
> performance by reducing round trips between the app and the server,
> but the use of a temp table in MySQL reduces the benefit of that.

No good reason. It would.
Regards / Mit vielen Grüßen,

   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <serg@stripped>
 / /|_/ / // /\ \/ /_/ / /__  Principal Software Engineer/Server Architect
/_/  /_/\_, /___/\___\_\___/  Sun Microsystems GmbH, HRB München 161028
       <___/                  Sonnenallee 1, 85551 Kirchheim-Heimstetten
Geschäftsführer: Thomas Schroeder, Wolfgang Engels, Wolf Frenkel
Vorsitzender des Aufsichtsrates: Martin Häring
why does UNION ALL use a temp table?MARK CALLAGHAN1 Aug
  • Re: why does UNION ALL use a temp table?Sergei Golubchik1 Aug
  • Re: why does UNION ALL use a temp table?Eric Jensen1 Aug
    • Re: why does UNION ALL use a temp table?dormando2 Aug