Re: [GENERAL] Optimize the query, help me please.

2011-11-23 Thread Achilleas Mantzios
Στις Wednesday 23 November 2011 12:56:23 ο/η Капралов Александр έγραψε: > Query is: > SELECT * FROM a UNION SELECT * FROM b ORDER BY time DESC LIMIT 100 > > how can i get only last 100 row from a and b and then do union. Explain of > select said that all recond selected from a and b. > In order

Re: [GENERAL] Optimize the query, help me please.

2011-11-23 Thread Bèrto ëd Sèra
Hi, (SELECT * FROM a limit 10) union (SELECT * FROM b limit 10) is what you need Bèrto 2011/11/23 Капралов Александр > Query is: > SELECT * FROM a UNION SELECT * FROM b ORDER BY time DESC LIMIT 100 > > how can i get only last 100 row from a and b and then do union. Explain of > select said t

Re: [GENERAL] Optimize the query, help me please.

2011-11-23 Thread Raymond O'Donnell
On 23/11/2011 10:56, Капралов Александр wrote: > Query is: > SELECT * FROM a UNION SELECT * FROM b ORDER BY time DESC LIMIT 100 > > how can i get only last 100 row from a and b and then do union. Explain > of select said that all recond selected from a and b. (select * from a order by time desc

[GENERAL] Optimize the query, help me please.

2011-11-23 Thread Капралов Александр
Query is: SELECT * FROM a UNION SELECT * FROM b ORDER BY time DESC LIMIT 100 how can i get only last 100 row from a and b and then do union. Explain of select said that all recond selected from a and b. thanks.