Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YD2Ub-0008FV-DO for pgsql-general@arkaria.postgresql.org; Mon, 19 Jan 2015 02:55:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YD2Ua-0003mL-L0 for pgsql-general@arkaria.postgresql.org; Mon, 19 Jan 2015 02:55:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YD2UZ-0003mE-Al for pgsql-general@postgresql.org; Mon, 19 Jan 2015 02:55:03 +0000 Received: from hogranch.com ([75.101.82.47]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YD2UQ-0004qv-2U for pgsql-general@postgresql.org; Mon, 19 Jan 2015 02:55:02 +0000 Received: from [192.168.0.2] (porker [192.168.0.2]) by hogranch.com (8.11.6/8.11.6) with ESMTP id t0J2siH22486 for ; Sun, 18 Jan 2015 18:54:44 -0800 Message-ID: <54BC71EF.4050505@hogranch.com> Date: Sun, 18 Jan 2015 18:54:39 -0800 From: John R Pierce User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: pgsql-general@postgresql.org Subject: Re: Partitioning References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------080804050202050405050007" X-HawgScanner-Information: Please contact the ISP for more information X-HawgScanner: Found to be clean X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org This is a multi-part message in MIME format. --------------080804050202050405050007 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 1/18/2015 5:58 PM, James Sewell wrote: > WITH idlist as (SELECT id from othertable) > SELECT id from mastertable WHERE id = idlist.id ); select mt.id, ... from mastertable mt join othertable ot on mt.id=ot.id; might optimize better. -- john r pierce 37N 122W somewhere on the middle of the left coast --------------080804050202050405050007 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
On 1/18/2015 5:58 PM, James Sewell wrote:
  WITH idlist as (SELECT id from othertable) 
    SELECT id from mastertable WHERE id = idlist.id);


    select mt.id, ...   from mastertable mt join othertable ot on mt.id=ot.id;

might optimize better.



-- 
john r pierce                                      37N 122W
somewhere on the middle of the left coast
--------------080804050202050405050007--