Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bIkPq-0002ft-SH for pgsql-bugs@arkaria.postgresql.org; Thu, 30 Jun 2016 22:26:34 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bIkPq-0002gu-BG for pgsql-bugs@arkaria.postgresql.org; Thu, 30 Jun 2016 22:26:34 +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 1bIjm2-0006zX-FC for pgsql-bugs@postgresql.org; Thu, 30 Jun 2016 21:45:26 +0000 Received: from pecan-mail.exetel.com.au ([220.233.0.8] helo=pecan.exetel.com.au) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bIjlw-0000vd-VO for pgsql-bugs@postgresql.org; Thu, 30 Jun 2016 21:45:24 +0000 Received: from 254.162.233.220.static.exetel.com.au ([220.233.162.254] helo=SNAPSHOT) by pecan.exetel.com.au with esmtp (Exim 4.84) (envelope-from ) id 1bIjlp-0008BH-AT; Fri, 01 Jul 2016 07:45:13 +1000 From: "Phil McGuinness" To: "'Tom Lane'" Cc: References: <000001d1d2c2$e1fede00$a5fc9a00$@sherlock.com.au> <19688.1467295751@sss.pgh.pa.us> In-Reply-To: <19688.1467295751@sss.pgh.pa.us> Subject: Re: PostGres 9.5 [ and earlier ] "SET SEARCH_PATH TO "+ cSchema + ";" Date: Fri, 1 Jul 2016 07:45:24 +1000 Message-ID: <005d01d1d318$b52d8470$1f888d50$@sherlock.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQFMnT5gbxpQwXZpWFMFsVQvMcbaVQJ36nX6oPk3A2A= Content-Language: en-us X-Pg-Spam-Score: -2.6 (--) 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 Tom Snip[ you have not provided sufficient detail to let someone else reproduce it. ] Will send a lot more information.. so you can reproduce it. To get around it.. we have explicit schema referencing and much faster. Phil McGuinness ----------- -----Original Message----- From: Tom Lane [mailto:tgl@sss.pgh.pa.us] Sent: Friday, 1 July, 2016 12:09 AM To: Phil McGuinness Cc: pgsql-bugs@postgresql.org Subject: Re: [BUGS] PostGres 9.5 [ and earlier ] "SET SEARCH_PATH TO "+ cSchema + ";" "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