Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kxKgl-0008Em-RH for pgsql-general@arkaria.postgresql.org; Thu, 07 Jan 2021 02:06:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kxKgk-0008B0-PQ for pgsql-general@arkaria.postgresql.org; Thu, 07 Jan 2021 02:06:10 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kxKgk-0008Ao-I3 for pgsql-general@lists.postgresql.org; Thu, 07 Jan 2021 02:06:10 +0000 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kxKge-0005TR-8T for pgsql-general@postgresql.org; Thu, 07 Jan 2021 02:06:09 +0000 Received: by mail-wr1-x435.google.com with SMTP id q18so4148703wrn.1 for ; Wed, 06 Jan 2021 18:06:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=FWRs+HSnfIFWc09nmLTicIc6vAbVzd/qtAAJuw5zKKA=; b=LK98rx8ooNxiQ2jVrzIDU9eRokm43k7DQqVMxk4a+oTo8DYC8swLasGeKAeNCbe0er IiE6bscJ5zK3wdxKl74DqyeMU8BSXxQ6YNtWuZ1ObBx42svN6BzMyxiGEQoJYrhc2IaT i3UYfSXXQByPBgyl44lwkHauRl72vY1UaVr4AV0+Nk53ezMO928SadrOrNlA3AlfjmQ3 h0hk1OcOEvsMWJPFYpgDH346V2DZQ0OTxOCH/yqHuRKFifSr3AIbv+WHvNu98EOsiTG7 tpWWJ9e+0/lbyAF8zpMbcvT/9FpfLldZwJcrlByLokmSDQvV+mNP2WVI4QggSfW+GZB8 UrgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=FWRs+HSnfIFWc09nmLTicIc6vAbVzd/qtAAJuw5zKKA=; b=rj2Gta3vkKfiULWOMk/h5q1tqtpBbHcse8o9n9Uso0LNPvFcamZECmTo3FeA1MC5E9 JEPsKPsj/Tz5U4e0ZoiVqki50Qo8o/qtWb7qObRWw8TxKF/TLqGV9z7MOlN7GK1eMk5P o+OT7f01mVUaZA/bnrmFJ9UYj5StAbRkIfHYTmNU1upyzeb9GSWMxE44iP/+R2yqRDu5 9XkgFpzJpOE3poeII5uQIakKdL0MnxVYD3padW9oXNIX5F8tOwmdk57ZwZykZGL+2Fmm H1fBD+i0wmOguyBT3yAIVFRd8Xhao9Y5CJATfp/hMGZugXEsBwSuMPcUmN46zNAz5P6T 9dCA== X-Gm-Message-State: AOAM531v/AA4jn8kQAuTFQPp6AocfqT8SooMVFffEeCQdYOylkssGJ3R d9QK9U/H3Jt/BZXu7Q7+HVQAGv8YUGu6zA== X-Google-Smtp-Source: ABdhPJynir/WFcV9bcZ7VGau6CT2aZ+ZGTQLLIrVohwo+Dwp9MhriOV3kIPdi+gwnRX14I0XKO2E5A== X-Received: by 2002:adf:fad0:: with SMTP id a16mr6925803wrs.390.1609985162636; Wed, 06 Jan 2021 18:06:02 -0800 (PST) Received: from localhost.localdomain (178-190-179-204.adsl.highway.telekom.at. [178.190.179.204]) by smtp.gmail.com with ESMTPSA id x66sm5021746wmg.26.2021.01.06.18.06.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Jan 2021 18:06:02 -0800 (PST) Message-ID: Subject: Re: Keep needing to run manual analyze From: Laurenz Albe To: Rob Northcott , "pgsql-general@postgresql.org" Date: Thu, 07 Jan 2021 03:06:01 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, 2021-01-06 at 17:28 +0000, Rob Northcott wrote: > We have an application that uses a Postgres database (currently 9.6). All the autovacuum/analyze settings are just left at the defaults. > We’ve had a few instances recently where users have complained of slow performance and running a manual Analyze > (not vacuum) on their database has resolved it. > Should it be considered normal that this needs to be done manually periodically even when autovacuum is on? > It’s not a very heavy application by a lot of people’s standards (it’s just a point-of-sale/stock-control system) > but there are a couple of hundred databases on the server, all in fairly constant use through the day. > Is it possible that the autovacuum/analyze isn’t running for some reason? If so, is there anything I > should look at to make it work better or should I just be looking at scheduling a manual vacuum/analyze > periodically on all databases? That is not necessary. You should figure out what tables need more frequent ANALYZE runs to get good execution plans and tune autoanalyze for these tables, for example by reducing the scale factor for them. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com