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 1stHKS-00Ex9e-Tc for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Sep 2024 02:00:33 +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 1stHKR-001Hjv-3B for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Sep 2024 02:00:31 +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 1stHKQ-001Hiw-HN for pgsql-hackers@lists.postgresql.org; Wed, 25 Sep 2024 02:00:30 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1stHKM-000wRf-9L for pgsql-hackers@postgresql.org; Wed, 25 Sep 2024 02:00:29 +0000 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-20551e2f1f8so72468805ad.2 for ; Tue, 24 Sep 2024 19:00:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1727229625; x=1727834425; darn=postgresql.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=hEvo3/SQ5xZud/6WHiRygm/D3W1UL7q99TQzt1Sl/fw=; b=A6oH3VyeQkMOh5bQu6qcooF5ECAOvl+BGBmbWDwarChvCkvRL6TBXbApMl/6ghXCOL pm75QqzvLwPrhZXFRbQ7kCaNgAKU8PHi3xyykYBy8z+K/7jDlflHxnS8vKw1ck+gg3/h KbTKLWnLcQ/6w4lfr+Nqq8qRbQZgGL8kTiiGc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727229625; x=1727834425; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hEvo3/SQ5xZud/6WHiRygm/D3W1UL7q99TQzt1Sl/fw=; b=qn3n//3YrwaG6kPREHrb8hbMARvskx/SQ/o21kHaWIZiqCSWI8/OnLwk1THm9676hL 47weU16zePuq8jEgpljikRo1oIJuAM6KE90qaurV/rmXJENLexxqG8fibCGSWCK5duES Earvw+gd3YSosWr+6N/HmCtgrIL8PO8r220lnY6Zk+hHROfv1D3q8PdBD939ERwE4C2w bgaxpMLBUlY1TYFIbmxPFLAYBxAs79KPW6vPSdVJLwKrnUpiKlVYcQJRSV0AW9pYp0J9 2vvfnb2Y1BL5a4vZzDzvqzF3TU8P1WhRYxmaCZUTYXQ/LrAp4MI7ORgCfx7afiBwpjsz PEvQ== X-Gm-Message-State: AOJu0YzfEOr/8UIbim+l0gSFGqx2raniJ9FiMPufzi/bcVW9uZcZpSjt v6bp6H2E1w8geO6YhUZS1KNFA7RQwy50Q/+s1gpELWurt6ed3QlBQthS9m0iAQ== X-Google-Smtp-Source: AGHT+IHoypchsD9DovOJ/Pfy9O0EMZj/L1iAdVw1QxT++YhRsXSBdmpICEEkie3Rw1sfcYfrBZZk3g== X-Received: by 2002:a17:902:dacc:b0:202:4047:e419 with SMTP id d9443c01a7336-20afc46accemr20279165ad.25.1727229624968; Tue, 24 Sep 2024 19:00:24 -0700 (PDT) Received: from google.com ([2600:1702:a20:5750::48]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20af17e2e36sm15550735ad.141.2024.09.24.19.00.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Sep 2024 19:00:24 -0700 (PDT) Date: Tue, 24 Sep 2024 19:00:22 -0700 From: Noah Misch To: Andres Freund Cc: pgsql-hackers@postgresql.org, Heikki Linnakangas , Robert Haas , Thomas Munro Subject: Re: AIO writes vs hint bits vs checksums Message-ID: <20240925020022.c5.nmisch@google.com> References: <20240924194340.92.nmisch@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.2.12 (2023-09-09) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Sep 24, 2024 at 04:30:25PM -0400, Andres Freund wrote: > On 2024-09-24 12:43:40 -0700, Noah Misch wrote: > > On Tue, Sep 24, 2024 at 11:55:08AM -0400, Andres Freund wrote: > > > Besides that, the need to copy the buffers makes checkpoints with AIO > > > noticeably slower when checksums are enabled - it's not the checksum but the > > > copy that's the biggest source of the slowdown. How big is that copy's contribution to the slowdown there? A measurable CPU overhead on writes likely does outweigh the unmeasurable overhead on index scans, but ... > > > Does this sound like a reasonable idea? Counterpoints? > > How should we think about comparing the distributed cost of the buffer > > header manipulations during index scans vs. the costs of bounce buffers? > > Well, the cost of bounce buffers would be born as long as postgres is up, > whereas a not-measurable (if it indeed isn't) cost during index scans wouldn't > really show up. ... neither BM_SETTING_HINTS nor keeping bounce buffers looks like a bad decision. From what I've heard so far of the performance effects, if it were me, I would keep the bounce buffers. I'd pursue BM_SETTING_HINTS and bounce buffer removal as a distinct project after the main AIO capability. Bounce buffers have an implementation. They aren't harming other design decisions. The AIO project is big, so I'd want to err on the side of not designating other projects as its prerequisites. > Zooming out (a lot) more: I like the idea of having a way to get the > permission to perform some kinds of modifications on a page without an > exlusive lock. While obviously a lot more work, I do think there's some > potential to have some fast-paths that perform work on a page level without > blocking out readers. E.g. some simple cases of insert could correctly be done > without blocking out readers (by ordering the update of the max page offset True.