pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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: Thu, 25 Jul 2019 15:52:48 -0700
Message-ID: <47c2bef2-a283-7849-2545-c1cb0dd5140e@aklaver.com> (raw)
In-Reply-To: <1564092985717-0.post@n3.nabble.com>
References: <1563909633976-0.post@n3.nabble.com>
	<1563993228524-0.post@n3.nabble.com>
	<18481dfb-af39-b6a2-7b27-88563cab7134@aklaver.com>
	<1564092985717-0.post@n3.nabble.com>

On 7/25/19 3:16 PM, PegoraroF10 wrote:
> So, what should I tune on autovacuum ?
> My script was running strangely. Postgres log shows me the time spent to
> create functions. That happens when creating triggers and tables too.
> Sometimes it´s too fast and sometimes ...

I didn't realize there is too fast:)  More below.

> 
> statement: create or replace function valoresdfe...     0 mins 1.135 secs
> statement: create or replace function dadosorigem...    0 mins 0.055 secs
> statement: CREATE OR REPLACE FUNCTION SONU...           0 mins 0.013 secs
> statement: create or replace function contatoscampa...	2 mins 13.492 secs
> statement: create or replace function FORMATARTELEF...  0 mins 0.013 secs
> statement: create or replace function ChecaVar          0 mins 0.012 secs
> statement: CREATE or replace FUNCTION criatrigge...     1 mins 16.42 secs

Are there other messages immediately(or close vicinity) before/after the 
slow statements?


> 
> So, is this a vacuum problem ? What do I need to configure it  ?

Configuration of autovacuum is done in postgresql.conf using these settings:

https://www.postgresql.org/docs/11/runtime-config-autovacuum.html

You might want to send the settings you have to the list. Also the 
setting for track_counts.


> And again, if I do a Reindex database before creating that schema, it works
> perfectly.
> 
> 
> 
> --
> Sent from: https://www.postgresql-archive.org/PostgreSQL-general-f1843780.html
> 
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (20+ messages)  latest in thread

Message-ID: <47c2bef2-a283-7849-2545-c1cb0dd5140e@aklaver.com>
Permalink:  ../47c2bef2-a283-7849-2545-c1cb0dd5140e@aklaver.com/
Also on:    postgresql.org/message-id/47c2bef2-a283-7849-2545-c1cb0dd5140e@aklaver.com

 · 

reply

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: <47c2bef2-a283-7849-2545-c1cb0dd5140e@aklaver.com>
  References: <1563909633976-0.post@n3.nabble.com> <1563993228524-0.post@n3.nabble.com> <18481dfb-af39-b6a2-7b27-88563cab7134@aklaver.com> <1564092985717-0.post@n3.nabble.com> <47c2bef2-a283-7849-2545-c1cb0dd5140e@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