Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sY36U-008SEe-Ve for pgsql-admin@arkaria.postgresql.org; Sun, 28 Jul 2024 12:34:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sY36T-00AtaY-Gy for pgsql-admin@arkaria.postgresql.org; Sun, 28 Jul 2024 12:34:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sY36T-00AtaJ-62 for pgsql-admin@lists.postgresql.org; Sun, 28 Jul 2024 12:34:21 +0000 Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sY36R-001tt6-8c for pgsql-admin@postgresql.org; Sun, 28 Jul 2024 12:34:20 +0000 Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2f0dfdc9e16so28045931fa.2 for ; Sun, 28 Jul 2024 05:34:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20230601.gappssmtp.com; s=20230601; t=1722170058; x=1722774858; darn=postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=f3s1gIlB4kZ91xMRtkhI4Q+rQnyOlVEx1pGX/URIW7c=; b=h7Tu3+UQv4oFrnQp9qz9tuS4iR5JTB+ekXyGn7X5k8GENbFXdrS04E8fVdKIc+Imus ymV/SMV01noLaAffwMVZNjM1x1RKsyq/uvUImivN0OIRyBpi3fhp8qZlApTZt+2Wqs8K eGyl0P6d6e+tPqrv9T5eMyJsTiI+MwMffWhTo7/r6uFtd46Nq+rE3f8w5QxyD8SwK/Hg h5Nf1FtbZn8yBUmU3G7SVbGvEih+fNVmw0QNHf09uCcj6IkRuVTvYXEzAI5W3RmGK1de pLJ9fKEkO8vhPCNHBu7UG2CVOajnM4QxhS9rTau2pgcsDGNTwg3rwCkn6/Q2AnK82K6E xZZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722170058; x=1722774858; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=f3s1gIlB4kZ91xMRtkhI4Q+rQnyOlVEx1pGX/URIW7c=; b=G4OAT8qcC4VVWQRvbMhI+d8DogRLTem79WJr0S5LLCQuMnNqkjh3Cn2HelGZ0LXy2q PsCJ+Pr1Zw1gX4HKuENsiKx6D7EA/ZmKvZAanRvspiRlfIGWjAqytfd3zSgxy/YXguOC AjaV/Dy13Z8kOMSuwA12yO0Ax+OE9BoK23xUL6LrbXs3Q4EF00F5ci57n5KdWv63Hbqd Urzz7VI7QpsUX860W+l58A5S07ou+1VO8/LtxjvZG8yZR9RCj2Zbh694QotGKaQWPpsL BZ/++D5iRh6APotAk6ol+agBmP/QdhFCR+4Gl1xGXeQTwps10YUx9e1F8YdkSS/9F2xh yp8A== X-Forwarded-Encrypted: i=1; AJvYcCUdYlqMhsbo8LuM1dpvHRnKu6DJhHY5CuLLGVJPjtgEJ2tui0Adu7Y2rs5/aR6sb/fEBBjC7da4mAw+WznuXgJh6+BIexXLa4iZvg== X-Gm-Message-State: AOJu0YyAq470JYY8rt9JTWH9C9Ck7uf4iHZbrnae4pa+iWnUPH6zOxpY 0JlUpjJo0WJ72uI3wjxAuhDklv2mey6aT/pdCGdbaLxU4aReYeoTCvJELAHaT+aXNaY+cOWvrWW Mk/4= X-Google-Smtp-Source: AGHT+IHFie4tuQ75XZnz0kJemqi0R3vo71DxTFOw1kUc2ZpKAMXm20Dlpx2qZA5rnBoXM+kf+IW0rA== X-Received: by 2002:a2e:7c07:0:b0:2ec:5c94:3d99 with SMTP id 38308e7fff4ca-2f12edf8009mr31114251fa.2.1722170057927; Sun, 28 Jul 2024 05:34:17 -0700 (PDT) Received: from dynamic-pd01.res.v6.highway.a1.net ([2001:871:260:122:471a:3e46:e6b0:faf6]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5ac631b035dsm4292642a12.13.2024.07.28.05.34.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jul 2024 05:34:17 -0700 (PDT) Message-ID: <567d7f791c4ac691a3f941f08cf30b5c277dddb9.camel@cybertec.at> Subject: Re: Faster pg_resore with autovacuum off? From: Laurenz Albe To: Ron Johnson , pgsql-admin Date: Sun, 28 Jul 2024 14:34:16 +0200 In-Reply-To: References: <4ecf57eb54f6d457357e3882c6e9b0e6eb89aa1b.camel@cybertec.at> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.3 (3.52.3-1.fc40) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, 2024-07-27 at 15:48 -0400, Ron Johnson wrote: > > If your machine is too weak to handle the combined workload of restore = + > > autovacuum, that might get you something.=C2=A0 Otherwise, you are just= cheating: > > the restore might be faster, but the database is not usable before auto= vacuum > > and autoanalyze have proessed all restored tables. >=20 > I 100% disagree with this: autovacuum is not necessary during pg_restore > (presuming there's only one database in the instance). It is not necessary during restore, but it is necessary if you want to use the database after the restore. Well, you can manually VACUUM and ANALYZE = the database, but why not do it automatically? I think that there are very few good reasons to ever disable autovacuum, an= d a restore is not among them. > Heck, it might not even be=C2=A0vital=C2=A0if you carefully monitor the o= ther databases > in the instance. ? Yours, Laurenz Albe