Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bIcfF-0004XV-9b for pgsql-bugs@arkaria.postgresql.org; Thu, 30 Jun 2016 14:09:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bIcfE-0006bg-Gl for pgsql-bugs@arkaria.postgresql.org; Thu, 30 Jun 2016 14:09:56 +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 1bIceb-0005th-Fw for pgsql-bugs@postgresql.org; Thu, 30 Jun 2016 14:09:17 +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 1bIceY-0008BG-7p for pgsql-bugs@postgresql.org; Thu, 30 Jun 2016 14:09:16 +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 u5UE9BJN019689; Thu, 30 Jun 2016 10:09:11 -0400 From: Tom Lane To: "Phil McGuinness" cc: pgsql-bugs@postgresql.org Subject: Re: PostGres 9.5 [ and earlier ] "SET SEARCH_PATH TO "+ cSchema + ";" In-reply-to: <000001d1d2c2$e1fede00$a5fc9a00$@sherlock.com.au> References: <000001d1d2c2$e1fede00$a5fc9a00$@sherlock.com.au> Comments: In-reply-to "Phil McGuinness" message dated "Thu, 30 Jun 2016 21:30:57 +1000" Date: Thu, 30 Jun 2016 10:09:11 -0400 Message-ID: <19688.1467295751@sss.pgh.pa.us> X-Pg-Spam-Score: -3.2 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org "Phil McGuinness" writes: > We used "SET SEARCH_PATH TO "+ cSchema + ";" to set say SHER2016 or > SHERDATA.. where ever we need to be and open tables as normal. > "INSERT INTO settings SELECT * FROM settings;") // We can use this > syntax rather explicit say sherdata. > .. Verse .. > "INSERT INTO settings SELECT * FROM sherdata.settings;") > When we use code with SET SEARCH PATH and not explicit schema the speed > difference is 8 time slower. This is really hard to believe, and you have not provided sufficient detail to let someone else reproduce it. A possible guess, though, comes from the fact that the default value of search_path is *not* empty; it is # show search_path ; search_path ----------------- "$user", public (1 row) If you are doing exactly what you show above, then you removed "public" from your search path, as well as the schema corresponding to your user name (if there is one). I wonder whether the "sherdata" schema contains a different and slower version of some function or view than exists in "public". regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs