Privet!


> What is faster: UNION or temporary table or something else ?



Sometimes MERGE tables could be used, but  the speed difference  between

UNION solution and MERGE is rather low. The temporary table for sorting

(ORDER clause causes this) should be created in all cases. So, if you

have to reuse data returned from the query several times, create a 

temporary table from results. BTW - what query (queries) are you going

to use for sorting data from several tables?  I see simple subquery like:



        create temporary table t1

        select a

        from (

                                        select a 

                                        from d1 

                                        union 

                                        select a 

                                        from d2

                                ) as foo

        order by a;



If you have faster solution (in several times) please introduce it. I've

seen similar issues at archives at:

  http://lists.mysql.com/mysql



odnako, I haven't found an exact answer. :)







íÉÈÁÉÌ íÏÎÁÛ£× <[EMAIL PROTECTED]> wrote:

> Hello,

> 

> I have 10 tables:

> table0: id, description, date

> table2: id, description, date

> ...

> table9: id, description, date

> 

> Every table has 1 000 000 rows.

> 

> How can I select all rows from this 10 tables ordered by date?

> What is faster: UNION or temporary table or something else ?

> 

> mysql 4.1

> 

> Sincerely,

> Michael,

> http://xoib.com/ http://3d2f.com/

> http://qaix.com/ http://ryxi.com/

> http://gyxe.com/ http://gyxu.com/

> http://xywe.com/ http://xyqe.com/

> 

> 



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
       <___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to