Optimize the query, help me please.

From: Капралов Александр <alnkapa(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Optimize the query, help me please.
Date: 2011-11-23 10:56:23
Message-ID: CAJqqVEXfy4Q8XK=4OEn6kA7VPeO3Yzwc+Wsk5i-U9HO8EmamKQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Raymond O'Donnell 2011-11-23 11:07:29 Re: Optimize the query, help me please.
Previous Message Scott Marlowe 2011-11-23 06:27:35 Re: autovacuum stuck on a table for 18+ hours, consuming lots of CPU time