Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bXImH-0006vr-OT for pgsql-performance@arkaria.postgresql.org; Wed, 10 Aug 2016 01:57:53 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bXImG-0001mx-Mq for pgsql-performance@arkaria.postgresql.org; Wed, 10 Aug 2016 01:57:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bXImF-0001m8-Jv for pgsql-performance@postgresql.org; Wed, 10 Aug 2016 01:57:51 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bXImD-0001ki-6k for pgsql-performance@postgresql.org; Wed, 10 Aug 2016 01:57:51 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u7A1vjOI014677; Tue, 9 Aug 2016 21:57:45 -0400 From: Tom Lane To: Suya Huang cc: Claudio Freire , "pgsql-performance@postgresql.org" Subject: Re: what's the slowest part in the SQL In-reply-to: References: <1D0FF65A-EAB9-453C-9B95-684E05B494B7@connexity.com> <001EBA46-372C-4325-9AC5-168E19949C8A@connexity.com> <12338.1470789923@sss.pgh.pa.us> Comments: In-reply-to Suya Huang message dated "Wed, 10 Aug 2016 01:43:54 -0000" Date: Tue, 09 Aug 2016 21:57:45 -0400 Message-ID: <14676.1470794265@sss.pgh.pa.us> X-Pg-Spam-Score: -2.3 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Suya Huang writes: > Thank you Tom very much, that’s the piece of information I miss. > So, should I expect that the nested loop join would be much faster if I cache both tables (use pg_prewarm) into memory as it waives the disk read? pg_prewarm is not going to magically fix things if your table is bigger than RAM, which it apparently is. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance