Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hqmbZ-0004lP-Cc for pgsql-general@arkaria.postgresql.org; Thu, 25 Jul 2019 22:52:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hqmbY-0005UZ-9h for pgsql-general@arkaria.postgresql.org; Thu, 25 Jul 2019 22:52:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hqmbW-0005DM-CM for pgsql-general@lists.postgresql.org; Thu, 25 Jul 2019 22:52:56 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1hqmbT-0000Uc-3s for pgsql-general@postgresql.org; Thu, 25 Jul 2019 22:52:53 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 14BF1222FF; Thu, 25 Jul 2019 18:52:50 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 25 Jul 2019 18:52:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=5 /1qA6AOlXFRbYFMc6UpK3/OU7i+daJBLUPquh9X8q0=; b=tSXmxX6vdBbqhlN1y /DErBDKAuXcWwsvEDu5bx24QKI2utmDq/4jY1h19w5Rx6/U1SMOJ7cjjFP6/ziia pZwALO5VpyPBn2lHEUNR1v058453noqshPMRnAKHZtOEZCT7JYkeKSZSILJ7ZP3r ZVBb+fbV11fcRf/umnCSZDH85bKg9RKQdvJqk+ndw3urtiNhXQUHZ2TBkwTxdF2P 7j20WL6VpXdSdpkyWYDSZsszzXn6UZ7xNgfi5GL1qGwtcdE9JCcPvotoJ0NqTwjj jjA8KU/ii8BN+VMIawLoH3dBjkYY1slN70ToBD4rbC+2VkKrvL1esAYfUMcDOspG k8sNg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=5/1qA6AOlXFRbYFMc6UpK3/OU7i+daJBLUPquh9X8 q0=; b=sLcfOsctAGTMKSjvSXWemsVsIerIkVrdrgcS2lVhhxPOaocBtOy516WMq bnnSjl1UV76nyyO09o5c//ITPQPtWSwge/nm6WVN48KsXhXwlNFxTtTzFdREd8gN mQ5Y8iX9VPLpzwKHYwidQfI6sbZ+/k0uu9FW6gruCoFvtK23VK4RA0/zgpcib7GC TGfBaNLi8TgMeEDGmqbAUh3snrYM9K+/XuszbtPfKeL91MK4FMPtLOzyKMmjeHaW P88snfypwbr6+BSWVVa5CJZILwnktxJ1Jj+L6LuRZof6JEQwqVX3WMM4kfuViO91 b0fyRWgbX/or81PW7VDZFZ5w7IBQA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrkeefgddugecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesthekre dttdefjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhl rghvvghrsegrkhhlrghvvghrrdgtohhmqeenucffohhmrghinhepphhoshhtghhrvghsqh hlqdgrrhgthhhivhgvrdhorhhgpdhpohhsthhgrhgvshhqlhdrohhrghenucfkphepjedu rddvuddvrdduhedtrddvtddvnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnh drkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from [192.168.1.4] (unknown [71.212.150.202]) by mail.messagingengine.com (Postfix) with ESMTPA id 435818005C; Thu, 25 Jul 2019 18:52:49 -0400 (EDT) Subject: Re: Too slow to create new schema and their tables, functions, triggers. To: PegoraroF10 , pgsql-general@postgresql.org 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> From: Adrian Klaver Message-ID: <47c2bef2-a283-7849-2545-c1cb0dd5140e@aklaver.com> Date: Thu, 25 Jul 2019 15:52:48 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <1564092985717-0.post@n3.nabble.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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