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 1iq2WG-0008Dk-FK for pgsql-bugs@arkaria.postgresql.org; Fri, 10 Jan 2020 22:12:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iq2WE-0003HN-HD for pgsql-bugs@arkaria.postgresql.org; Fri, 10 Jan 2020 22:12:38 +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 1iq2WE-0003HG-5b for pgsql-bugs@lists.postgresql.org; Fri, 10 Jan 2020 22:12:38 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iq2WB-00062R-4F for pgsql-bugs@lists.postgresql.org; Fri, 10 Jan 2020 22:12:36 +0000 Received: by mail-wr1-x443.google.com with SMTP id y17so3240335wrh.5 for ; Fri, 10 Jan 2020 14:12:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=NmVdDUfwrsBYgmycIhKEEUVJP+Ncx/GFrusDALC4Pnw=; b=FQlOtVp2u3xqIa+EYZlysZzFpkh5E/UxZO/5isC7vqptMPa1YWhqjnukSpNR2F5pZJ MGYIzPZDr1VzAp4Hl6FLJleZbN7BNL/E1gg7+jbhaJePks0jtfn9Vl0haBn36qSVsz35 6lHTEL9ZVwyCcYYg8KfwkF3fBUr8lGP2YglWvx+PgmcVZ1G4ZpP+yVjbhJp+wb5KC34l dMVpaxH/4TGq117k+xsmn+bVWawKnhpmkua+0sNVs0pqfg/q3PPeWBurKcfST3d2Igjy oTmMxe6lF+IVR7eCQ97TjzVZ24qRk+ZzyCt4sMPiAsuCMmTXloQYBe89HQZxbPYibPsZ UPzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=NmVdDUfwrsBYgmycIhKEEUVJP+Ncx/GFrusDALC4Pnw=; b=qCTqqRfnRNtdqOdwbf8mAiSRwA44bUidHFC5zD7E6sXlIve/2YHGcF+BdH4KTdhmw6 CwlVUzliGMyxG3t8PquVykmrV+W2/EB9SGqUU5SzrsuXID3xljAwL6oxTyE6utPeS+j5 IwpMHt2KXKrfTKm1biJ3Z3SfqbGPoVbiGvhw94HpbZsRCcW9Ia0nt/aVedPCfqv1vZ0t rSU3KV8eCbncAR2IQPmFRaRCAgJacT2X1PeIGghtB+7w7xzoYmt1AyN3hH7ATe44eVGH TE2INJQLBrFN1OrbDnF5pxDGhppQx/jaYZGb3ytEjkKDpYSv1Jxlj8xFwI93DJZqDXNz Wxaw== X-Gm-Message-State: APjAAAW5j2jfwdvmtiAReGOG2bc4Pgqx+wyw3SaTf95OaGQLphxZfbaz Jurs7qUEHQZwpAIshtZMtXkgTg== X-Google-Smtp-Source: APXvYqzloaEsdrscMg6IK6d9sv9V5uuJci4C6GvubEJzZFp1d66Fne8Ow/pjCyQale25TF5Lo+iY3Q== X-Received: by 2002:adf:ebc3:: with SMTP id v3mr5468063wrn.280.1578694353583; Fri, 10 Jan 2020 14:12:33 -0800 (PST) Received: from localhost (ip-86-49-253-92.net.upcbroadband.cz. [86.49.253.92]) by smtp.gmail.com with ESMTPSA id g21sm3877683wrb.48.2020.01.10.14.12.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jan 2020 14:12:32 -0800 (PST) Date: Fri, 10 Jan 2020 23:12:31 +0100 From: Tomas Vondra To: "maschka, sam" Cc: pgsql-bugs@lists.postgresql.org Subject: Re: Autovacuum potential bug Message-ID: <20200110221231.n57a4uwtojup32lu@development> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On Fri, Jan 10, 2020 at 02:13:47PM -0700, maschka, sam wrote: >We have been seeing an issue where reads on a table seem to slowly degrade >over time. When we run VACUUM ANALYZE on the table the operations perform >much better. It usually takes about a week or two for the reads to degrade >to a point where we have to manually run VACUUM ANALYZE. This has been >happening to a handful of our tables. The mutation operations ran against >these tables are mainly update operations. Very few insert and delete >operations are ran against these tables. Also a jsonb object stores most of >the data within each record. The size of the jsonb object can vary widely >between records. We thought the autovacuum facility would have prevented us >from having to periodically run VACUUM ANALYZE. Is this a bug or is it a >configuration issue on our tables? > Unfortunately that's impossible to answer without providing much more detailed information about the issue. This could easily be just a matter of autovacuum not being aggressive enough on those tables, for example. I don't think this qualifies as a bug, certainly not in the current shape. Perhaps we'll discover something, but if I had to guess at this point, I'd say it's likely a configuration issue. I suggest you post a more detailed report to pgsql-performance [1] with much more details. Right of the bat we need to know - PostgreSQL version - size of the database - non-default configuration - what type of queries you're running - how much slower it gets (2x, 10x, 100x?) - does autovacuum run at all on the tables? - does the execution plan change? - if the execution plan does not change, maybe try some CPU profiling There's also [2] which is primarily focused on slow query analysis, but maybe it'll give you ideas what other information to provide. regards [1] https://www.postgresql.org/list/pgsql-performance/ [2] https://wiki.postgresql.org/wiki/Slow_Query_Questions -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services