Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1esD1H-0006h6-Ag for pgsql-bugs@arkaria.postgresql.org; Sat, 03 Mar 2018 19:40:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1esD1G-0004Bo-9r for pgsql-bugs@arkaria.postgresql.org; Sat, 03 Mar 2018 19:40:34 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1esD1F-0004B7-W4 for pgsql-bugs@lists.postgresql.org; Sat, 03 Mar 2018 19:40:34 +0000 Received: from mail-it0-x22b.google.com ([2607:f8b0:4001:c0b::22b]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1esD1B-0007AM-MG for pgsql-bugs@lists.postgresql.org; Sat, 03 Mar 2018 19:40:32 +0000 Received: by mail-it0-x22b.google.com with SMTP id k135so5248483ite.2 for ; Sat, 03 Mar 2018 11:40:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openscg.com; s=oscggmail; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=7D/BYsuhCDiPKF3fUqum0xybafdLt4ocEkr3M8qPXUY=; b=NIrLnW5nT24OSzZElNMu6ZQ/QU7tTBvWxrt7wDWOdqUQdc+MjWR5Pwp9jIK1/4ShYA 4+V6jcs4clA6lLANlYBJxcOD1uw68fn58VrLxK5Xbuf+N+IJTv6FH3WIWkYHzitzjts3 yBGwN998qJSfwDvxCbpG4YYB7gcudYAesjshs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=7D/BYsuhCDiPKF3fUqum0xybafdLt4ocEkr3M8qPXUY=; b=YOpU6l4UTDDDhEjkWkIBg+/prbFALsVv4fOiSEysZRaRmdlNDoyDHZlVSDhSNAeBDF TB1YMuHsxYm/EvIW0zWD2SVDCk3ezLcrDzODJZ/dnWqk47vCwtmx13il/AYg8vM7UzFh yHYO0cS1EP7CZeUfaHefiVKLxetcE0z2TKkGVUjSmFMHHYGhT2SBCYG/4GNEAJVMczWG 6P6R712+kwUyKlZDeelPIeBao4fYSNtvlIyuVMfWIT6M/riITOHLGgfCxO1mtQ5NXe1b uceOC2hBQqc2iC3FkahugCoscgCpH7wvb5m1KgJsGwTzhkt2M47bZRwsFJ0uVzBE3KII bFdw== X-Gm-Message-State: AElRT7FKU/3xEb6H1yEx+nsTHl2Zc906HbfznkjrMQjAbPU1LvHwWLgh wCQmBuFGKb+vO06uw+eHNcRv2y2Tg9I= X-Google-Smtp-Source: AG47ELtDe742SOkUeuedByq4ATfQjre7q9FOpkytP1z/mSVh6eQoEdaadg/ZbEAZQWghWv8VThFnMw== X-Received: by 10.36.121.195 with SMTP id z186mr7910977itc.148.1520106028069; Sat, 03 Mar 2018 11:40:28 -0800 (PST) Received: from decina.attlocal.net ([2600:1700:200:8d60:c59b:8e92:aa1a:e448]) by smtp.gmail.com with ESMTPSA id v2sm5720214iob.21.2018.03.03.11.40.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Mar 2018 11:40:26 -0800 (PST) Subject: Re: BUG #15067: Documentation or behaviour bug with autovacuum thresholds? To: Greg Clough , Euler Taveira , "pgsql-bugs@lists.postgresql.org" References: <151861949011.1450.18007996621988910831@wrigleys.postgresql.org> From: Jim Nasby Message-ID: Date: Sat, 3 Mar 2018 13:40:24 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 3/1/18 5:13 AM, Greg Clough wrote: > 1) autovacuum_vacuum_scale_factor = 0 > 2) autovacuum_vacuum_threshold = 500 > 3) Update 500 rows of a 1,000 row table > 4) Wait 30 seconds > 5) Update 1 row > 6) NOTE: "tuples: 1 removed" in the postgres.log, not "tuples: 501 removed". > > < 2018-02-14 15:20:08.512 GMT > LOG: automatic vacuum of table "postgres.public.autovacuum_threshold_test": index scans: 0 > pages: 0 removed, 7 remain, 0 skipped due to pins, 0 skipped frozen > tuples: 1 removed, 1000 remain, 0 are dead but not yet removable That indicates that the vacuum ran when there were only 1000 rows in the table, 1 of which had been updated. Obviously that doesn't make sense given your example, so I'm wondering if you did a single-row update some time before step 3. Note that after step 3 vacuum should report 1500 tuples, not 1000 (pretty sure that's true regardless of the tuples being HOT or not). I suggest posting a complete test script demonstrating the behavior you're seeing. -- Jim Nasby, Chief Data Architect, Austin TX OpenSCG http://OpenSCG.com