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 1iLO6j-0002Lz-ED for pgsql-general@arkaria.postgresql.org; Fri, 18 Oct 2019 08:59:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iLO6g-0006x2-7k for pgsql-general@arkaria.postgresql.org; Fri, 18 Oct 2019 08:59:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iLO6f-0006wt-Q7 for pgsql-general@lists.postgresql.org; Fri, 18 Oct 2019 08:59:33 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iLO6Y-0001gc-PC for pgsql-general@lists.postgresql.org; Fri, 18 Oct 2019 08:59:33 +0000 Received: by mail-wr1-x443.google.com with SMTP id l10so4933881wrb.2 for ; Fri, 18 Oct 2019 01:59:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zunibal-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=8C1cQkBgO9ieVcbg6ju9BqVw9JWjuMSApGg4qfyAMks=; b=shIlhsofUBxGNGw+BSrLRyxsLOGAOX7uZVLXFpRic5YfObLlz87C82/4G34XlxJuwV SQNv1DDgzGruy4N6clG3L/NT8RxnhsQ8Bc89cf2/gg+NrQPbnQMO7Ud3Qpe7ATeV+pSu KUJNOPhlQo+sErTjOzPxGCzvL1A8vpC6FMRG/6DbAvxtXi4D4fzrGY4FFBO7pb5N6b+n AfUkyBnqMORryQA+Sr/Vw1aV8yq5CF1Qm6xBXDC7UlfEeSLiItKxgGeWBJS5vL0UAEfN PDvT8rMgWzM+6BQE+y+H87C8n773AwE3QT5azja7SbyWI0jyazOaz3v5YDAsoj8Z82Lg n1tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=8C1cQkBgO9ieVcbg6ju9BqVw9JWjuMSApGg4qfyAMks=; b=uUESJSmIt457MaIGm6nuMSKwXZoaCtH0Gl0FJeDg2inZo9xfftjG+T1a5Yk36oNWlk 2WdYIynWHtqIZEZp2o7gFSwMBsbjK6QdBPJLXw0XyGBQCpaUMMsDdUHVqYMOjOfVtMye sGULp630TosaeKwLcu9ziP2BIIf32bV9otv2euI3lvznTD6PbbcfzBvCKgVtajBkCA1f g7I1GK0w1cKi21Zp4RwQ0KfNeRDou+gWlsQnr+z2HlRwhwGz+eM2YD2v3IC8Ia8+vch6 ODEz3ksoQXJjsded1cELwzIZ8ydnDKO1fq6PWih7p9SJXvrO+l/SQnj5Vg7gb1AQSXtL qG/w== X-Gm-Message-State: APjAAAUpskicI4pZ0IOz6uthhpGI+uJDsaut8vg7onjarpAcGESPyrw9 4S/GyIgAlS2mhyKPbr3vmGFq54nkauo= X-Google-Smtp-Source: APXvYqwXleNhaezWHHXz2bBSjouVmFMHmZ2BkZXKpgLRpxX4zUzMeyVuDb7NvcNVadKMTkfqczWxDQ== X-Received: by 2002:adf:828c:: with SMTP id 12mr6772309wrc.40.1571389160566; Fri, 18 Oct 2019 01:59:20 -0700 (PDT) Received: from [192.168.3.150] ([176.222.91.85]) by smtp.gmail.com with ESMTPSA id r12sm4959534wrq.88.2019.10.18.01.59.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Oct 2019 01:59:19 -0700 (PDT) Subject: Re: Sv: Conflict between autovacuum and backup restoration To: Andreas Joseph Krogh Cc: pgsql-general@lists.postgresql.org References: From: Ekaterina Amez Message-ID: <19096b9a-a5da-4097-6b19-fb05440dceb6@zunibal.com> Date: Fri, 18 Oct 2019 10:59:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------DFCA075EDA656FE5EC43D071" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------DFCA075EDA656FE5EC43D071 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit El 17/10/19 a las 16:12, Andreas Joseph Krogh escribió: > > > But I don't understand why I'm getting those messages about autovacuum > blocking db restore process. I guess that after one table is created > with COPY sentence, as many rows have been inserted, autoanalyze > process > runs to gather statistics for the Execution Planner. But why is > happening this block? Is autoanalyze running before the table gets > fully > loaded? Is this really a problem? If so, how can I handle it? This > task > is running at night, when nobody is using second database. > > > Thank you for reading, > > Ekaterina > > It is normal to get these "canceling autovacuum"-messages when > restoring a database, just ignore them. > If it bothers you, just turn autovacuum off by setting this in > postgresql.conf: > autovacuum = off > and reload the config (SIGHUP) The server stores more Production databases and I don't want to interfere with them, and turning off autovacuum will affect all of them. I've been looking for other parameters that could help me to avoid autoanalyze during  backup restoration but all of them (at least the ones I've been exploring) have sighup context associated, like autovacuum. Is there any parameter (in v8.4) that could somehow stop autoanalyze only in the connection used to restore the database? > -- > Andreas Joseph Krogh --------------DFCA075EDA656FE5EC43D071 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit


El 17/10/19 a las 16:12, Andreas Joseph Krogh escribió:


But I don't understand why I'm getting those messages about autovacuum
blocking db restore process. I guess that after one table is created
with COPY sentence, as many rows have been inserted, autoanalyze process
runs to gather statistics for the Execution Planner. But why is
happening this block? Is autoanalyze running before the table gets fully
loaded? Is this really a problem? If so, how can I handle it? This task
is running at night, when nobody is using second database.


Thank you for reading,

Ekaterina
 
It is normal to get these "canceling autovacuum"-messages when restoring a database, just ignore them.
If it bothers you, just turn autovacuum off by setting this in postgresql.conf:
 
autovacuum = off
 
and reload the config (SIGHUP)

The server stores more Production databases and I don't want to interfere with them, and turning off autovacuum will affect all of them.

I've been looking for other parameters that could help me to avoid autoanalyze during  backup restoration but all of them (at least the ones I've been exploring) have sighup context associated, like autovacuum. Is there any parameter (in v8.4) that could somehow stop autoanalyze only in the connection used to restore the database?


 
--
Andreas Joseph Krogh
--------------DFCA075EDA656FE5EC43D071--