Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 156529FB64D for ; Wed, 28 Feb 2007 07:05:51 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 21553-06 for ; Wed, 28 Feb 2007 07:05:39 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by postgresql.org (Postfix) with ESMTP id B18969FB640 for ; Wed, 28 Feb 2007 07:05:43 -0400 (AST) Received: from server3.office.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id 53C817676E; Wed, 28 Feb 2007 11:05:41 +0000 (GMT) Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id 333D6274092; Wed, 28 Feb 2007 11:05:41 +0000 (GMT) Message-ID: <45E56204.1040202@archonet.com> Date: Wed, 28 Feb 2007 11:05:40 +0000 From: Richard Huxton User-Agent: IceDove 1.5.0.9 (X11/20061220) MIME-Version: 1.0 To: calendarw Cc: pgsql-sql@postgresql.org Subject: Re: How to union table without union statement? References: <9d91f7aa0702280233r7c91dedav1ddfaffa92877280@mail.gmail.com> In-Reply-To: <9d91f7aa0702280233r7c91dedav1ddfaffa92877280@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.213 tagged_above=0 required=5 tests=AWL, BAYES_50, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200702/288 X-Sequence-Number: 27622 calendarw wrote: > Hi, > > I need to combine 10 tables which contain same table structure and join an > "other table" to show the latest 200 record, I am join the "other table" > first and using union statement to select all record now but the collection > time is super slow, how can I improve the collection speed? Start by providing the information needed to diagnose the problem. Post the output of EXPLAIN ANALYSE along with the query SQL and any table definitions/sizes you think are useful. -- Richard Huxton Archonet Ltd