Re: Optimize the query, help me please. - Mailing list pgsql-general

From Bèrto ëd Sèra
Subject Re: Optimize the query, help me please.
Date
Msg-id CAKwGa_8oFaFzVZqPF6goqKOrSj8Y-oo2jtUoMkrsoE2_Ekv0BQ@mail.gmail.com
Whole thread Raw
In response to Optimize the query, help me please.  (Капралов Александр<alnkapa@gmail.com>)
List pgsql-general
Hi,

(SELECT * FROM a limit 10) union (SELECT * FROM b limit 10)

is what you need

Bèrto

2011/11/23 Капралов Александр <alnkapa@gmail.com>
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.



--
==============================
If Pac-Man had affected us as kids, we'd all be running around in a darkened room munching pills and listening to repetitive music.

pgsql-general by date:

Previous
From: Raymond O'Donnell
Date:
Subject: Re: Optimize the query, help me please.
Next
From: Achilleas Mantzios
Date:
Subject: Re: Optimize the query, help me please.