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 1slE8G-0068mR-Ij for pgsql-general@arkaria.postgresql.org; Mon, 02 Sep 2024 20:58:41 +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 1slE8E-002JWU-9q for pgsql-general@arkaria.postgresql.org; Mon, 02 Sep 2024 20:58:38 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1slE8D-002JW7-QA for pgsql-general@lists.postgresql.org; Mon, 02 Sep 2024 20:58:38 +0000 Received: from meesny.iki.fi ([195.140.195.201]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1slE86-000LN0-9H for pgsql-general@lists.postgresql.org; Mon, 02 Sep 2024 20:58:36 +0000 Received: from [192.168.1.110] (dsl-hkibng22-54f8db-125.dhcp.inet.fi [84.248.219.125]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hlinnaka) by meesny.iki.fi (Postfix) with ESMTPSA id 4WyLh22PqyzyRk; Mon, 2 Sep 2024 23:58:25 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1725310706; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AeGymJvDMxZzuozkFwQ/9/aUecjTnTWEPdSHHKqPrM0=; b=GL/kLsK/MPM6viyQJ1JlfVmly8FjGAHog0sszbci7I2t/D1WncuCky2Vge+C3Qyw0rmVcs hb/D/sYcXOhDCnDRJyD6Nxv32M6EPhPHPisIsbT2gV3uBzkiKDgklfpXnCPfjwxEj+JHOz 2TLnbdp5+8x6yfsUcd+pzq/k7uzobuY= ARC-Seal: i=1; s=meesny; d=iki.fi; t=1725310706; a=rsa-sha256; cv=none; b=p89LkCjsz1bE2ZWSl0HT3vk0GMr0fSHwzKF/yb91kix3PRgCjrhGa68lh/VL+L7zVlWpTY GvQ/b3eblhB9ku0V0tEJd+kUGcFju3Xmp3ovYIUZWvdHuBVJvWVMWpjwJzgnXprAHGCmHG 4KVZsAzMJpbTMzGt42yGtW8uePlNzpM= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1725310706; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AeGymJvDMxZzuozkFwQ/9/aUecjTnTWEPdSHHKqPrM0=; b=gxe2UYAern/kIziA1tZ0xIlO+3oAxJ6b2y3Gl/iKnEr5XbQ1knuF0g+EQnGeRCQX1L/cYA /ztz6O+kTFczu6xNCmezqIai+QUN1iXIVfRJq/09ea4ge/LtNMJhzh+FwcjeaIp3shtR22 uloEBY4To7b3O8rPoce/CmsCDw3M8d0= Message-ID: <7760d3e3-15cc-4abf-ab33-027008c17d53@iki.fi> Date: Mon, 2 Sep 2024 23:58:25 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: PG17 optimizations to vacuum To: Pavel Luzanov , Melanie Plageman , Peter Geoghegan Cc: "pgsql-generallists.postgresql.org" References: <3bda0d10-0d60-42b7-9600-abe23d54bb16@postgrespro.ru> <7bc8da54-fe4f-4ff2-aa4e-b54fc91df586@postgrespro.ru> Content-Language: en-US From: Heikki Linnakangas In-Reply-To: <7bc8da54-fe4f-4ff2-aa4e-b54fc91df586@postgrespro.ru> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 02/09/2024 23:35, Pavel Luzanov wrote: > On 02.09.2024 22:23, Melanie Plageman wrote: >> For some reason I stopped being able to reproduce Pavel's case. I also cannot reproduce this. > I repeated the test on another computer, but compared master with v15. > The results are the same. The test can be simplified as follows: > > CREATE TABLE t(id integer) WITH (autovacuum_enabled = off); > INSERT INTO t SELECT gen.id FROM generate_series(1,3_500_000) gen(id); > CREATE INDEX t_id ON t(id); > VACUUM FREEZE t; > UPDATE t SET id = id + 1; > VACUUM FREEZE VERBOSE t; > > My results (only line with WAL info from the last VACUUM command). > > master: > WAL usage: 119583 records, 37231 full page images, 272631468 bytes > > v15: > WAL usage: 96565 records, 47647 full page images, 217144602 bytes Can you dump the stats with pg_waldump please. Something like: CREATE TABLE t(id integer) WITH (autovacuum_enabled = off); INSERT INTO t SELECT gen.id FROM generate_series(1,3_500_000) gen(id); CREATE INDEX t_id ON t(id); SET maintenance_work_mem = '1MB'; UPDATE t SET id = id + 1; select pg_current_wal_insert_lsn(); -- <<< PRINT WAL POS BEFORE VACUUM VACUUM FREEZE VERBOSE t; And then: pg_waldump -p data/pg_wal/ -s 1/F4474498 --stats=record where "1/F4474498" is the position printed by the "SELECT pg_current_wal_insert_lsn()" above. Do you have any non-default settings? "select name, current_setting(name), source from pg_settings where setting <> boot_val;" would show that. -- Heikki Linnakangas Neon (https://neon.tech)