From: Phil McGuinness <sherlock@sherlock.com.au>
To: pgsql-bugs@postgresql.org
Cc: 'Phil McGuinness' <sherlock@sherlock.com.au>
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> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
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
<mailto:sherlock@sherlock.com.au> sherlock@sherlock.com.au
cid:image010.png@01D16777.DD4FD1E0
Attachments:image001.jpg (image/jpeg, 2.4K) downloadview image
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: sherlock@sherlock.com.au
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>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox