From: Adrian Klaver <adrian.klaver@aklaver.com>
To: PegoraroF10 <marcos@f10.com.br>
To: pgsql-general@postgresql.org
Subject: Re: Too slow to create new schema and their tables, functions, triggers.
Date: Tue, 23 Jul 2019 12:36:18 -0700
Message-ID: <8db09c7e-dcbc-3f19-c72b-ccd085ff0b7a@aklaver.com> (raw)
In-Reply-To: <1563909633976-0.post@n3.nabble.com>
References: <1563909633976-0.post@n3.nabble.com>
On 7/23/19 12:20 PM, PegoraroF10 wrote:
> We have in a single database 190 identical schemas. Now, when we create a new
> one, with exactly same structure as the previous ones, it takes 20 or 30
> minutes to finish. Usual time to finish that script was 30 seconds.
>
> Basically, my script creates an entire structure for a new customer:
> - Create schema TempSchema; --just to be sure that nobody will connect until
> it finishes
> - create tables (100), constraints, functions, etc.
> - import data using restore only data.
> - rename TempSchema to production name.
>
> On second step, when creating tables, functions and so on, it takes
> sometimes a minute just to create one table or one function.
Can you show example of portion of script?
Have you looked at the Postgres log during the above to see if there any
relevant messages?
>
> So, does this happens because we have almost 200 schemas on that database ?
> I´m almost sure about.
> What do I need do to run my script as before ? Do I need to Reindex ? Vacuum
> ? Or am I reaching a limit in a number of schemas in a Postgres database ?
>
>
>
> --
> Sent from: https://www.postgresql-archive.org/PostgreSQL-general-f1843780.html
>
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
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-general@postgresql.org
Cc: adrian.klaver@aklaver.com, marcos@f10.com.br
Subject: Re: Too slow to create new schema and their tables, functions, triggers.
In-Reply-To: <8db09c7e-dcbc-3f19-c72b-ccd085ff0b7a@aklaver.com>
References: <1563909633976-0.post@n3.nabble.com> <8db09c7e-dcbc-3f19-c72b-ccd085ff0b7a@aklaver.com>
* 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