Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bIcXi-0004Cn-Qq for pgsql-bugs@arkaria.postgresql.org; Thu, 30 Jun 2016 14:02:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bIcXi-00025W-DZ for pgsql-bugs@arkaria.postgresql.org; Thu, 30 Jun 2016 14:02:10 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bIaBW-0003mY-J0 for pgsql-bugs@postgresql.org; Thu, 30 Jun 2016 11:31:06 +0000 Received: from pecan-mail.exetel.com.au ([220.233.0.8] helo=pecan.exetel.com.au) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bIaBN-0000aV-Im for pgsql-bugs@postgresql.org; Thu, 30 Jun 2016 11:31:04 +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 1bIaBI-00045b-AW; Thu, 30 Jun 2016 21:30:52 +1000 From: "Phil McGuinness" To: Cc: "'Phil McGuinness'" Subject: PostGres 9.5 [ and earlier ] "SET SEARCH_PATH TO "+ cSchema + ";" Date: Thu, 30 Jun 2016 21:30:57 +1000 Message-ID: <000001d1d2c2$e1fede00$a5fc9a00$@sherlock.com.au> MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_NextPart_000_0001_01D1D316.B3BB8FD0" X-Mailer: Microsoft Outlook 14.0 Thread-Index: AdHRM6fsPMMKKtDlQSicelXiMRBNww== Content-Language: en-us X-Pg-Spam-Score: -1.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 This is a multipart message in MIME format. ------=_NextPart_000_0001_01D1D316.B3BB8FD0 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0002_01D1D316.B3BB8FD0" ------=_NextPart_001_0002_01D1D316.B3BB8FD0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, Enjoy Postgres very much and have been in a long journey of several years to convert and older Windows system using DBF/FPT to all SQL. We had a directory structure in old system to connect to history for each year.. We SCHEMA's to represent that directory structure. So we have database with license number say 1234567-7654321 and schemas ; say SHER2016 and SHER 2015 back to say SHER1997 In each schema there is basically the same 49 databases [ tables, indexes etc ] 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. We are seeing 331 milliseconds down to 30 milliseconds by not using SEARCH_PATH We have spent days changing our syntax to pass the schema name [ path ] through our the code. Would have believe the SET SEARCH_PATH would have worked faster or the same.. but it is not. Thought you should know. Phil McGuinness - General Manager - Sherlock Software sherlock@sherlock.com.au cid:image010.png@01D16777.DD4FD1E0 ------=_NextPart_001_0002_01D1D316.B3BB8FD0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi,

 

<= p class=3DMsoNormal>Enjoy Postgres very much and = have been in a long journey of several years to convert and older = Windows system using DBF/FPT to all SQL.

We = had a directory structure in old system to connect to history for each = year..

We SCHEMA’s to = represent that directory structure.

 

<= p class=3DMsoNormal>So = we have database with license number say  1234567-7654321 and =  schemas ; say SHER2016 and SHER 2015 back to say = SHER1997

In each schema there is = basically the same 49 databases [ tables, indexes etc = ]

 

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.

We are seeing 331 = milliseconds down to 30 milliseconds by not = using = SEARCH_PATH

 

We have = spent days changing our syntax to pass the schema name [ path ] through = our the code.

Would have believe the = SET SEARCH_PATH would have worked faster or the same.. but it is = not.

 

Thought you should know.

 

Phil McGuinness  - = General Manager = – Sherlock Software  sherlock@sherlock.com.au

 

3D"cid:image010.png@01D16777.DD4FD1E0"

 

 

------=_NextPart_001_0002_01D1D316.B3BB8FD0-- ------=_NextPart_000_0001_01D1D316.B3BB8FD0 Content-Type: image/jpeg; name="image001.jpg" Content-Transfer-Encoding: base64 Content-ID: /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAoHBwkHBgoJCAkLCwoMDxkQDw4ODx4WFxIZJCAmJSMg IyIoLTkwKCo2KyIjMkQyNjs9QEBAJjBGS0U+Sjk/QD3/wAALCABpAF0BAREA/8QAHwAAAQUBAQEB AQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1Fh ByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZ WmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXG x8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/9oACAEBAAA/APZaMUYoxWP4l8VaX4Ts VutVmKq52xxou53PfA/r0rg7r4ySzXkf9m6PKtoUO5rpAG3dsYbGD/nNQS/FrVY721luNOigsCwE yx7ZZDnoqneOvqQPpXW6T8SdG1K4EFws+nyMcKbpQEY+m8EgH64rrhg9KMVka9qj6X9mMa7vNcqf yrRtJjPArnqRU1LRUVxcQ2lvJPcSLFDEpd3Y4C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