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 1uPSmk-008X9z-BS for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Jun 2025 21:15:02 +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 1uPSmg-006jOm-7c for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Jun 2025 21:14:58 +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 1uPSmf-006jOd-Sd for pgsql-hackers@lists.postgresql.org; Wed, 11 Jun 2025 21:14:58 +0000 Received: from mail-il1-x12d.google.com ([2607:f8b0:4864:20::12d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uPSme-001UcK-2d for pgsql-hackers@lists.postgresql.org; Wed, 11 Jun 2025 21:14:57 +0000 Received: by mail-il1-x12d.google.com with SMTP id e9e14a558f8ab-3dc729471e3so1317505ab.1 for ; Wed, 11 Jun 2025 14:14:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749676496; x=1750281296; darn=lists.postgresql.org; h=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=uFUoBzQ6+vuOkFkBZSKFMXX6VCTYEVAzTjm5ZSGLmeY=; b=Be9oP8wtsBMqqawgqM9HAldn4LMDim4EJSMMvPX3S1BxUKl53ebd7n/iiVIf57wKwz vw3rSCavBe7xRIp9ZC3XTu0VIkjZYa2HmX8/VyDcSXbUPn+VYOjFNAcWlzn/pBf/fSjv VCHuVYaz2LLLyPHm9lV4teR88Wlm5xFtmQZhQqSkJXzqwOXU8B+ZvzdxqriAjZ1CunBL AUZR64+bvihnL4nOqVtY8h2YaAPOBTkb/+y7+Ruq+6vS+h8+KkW6A4NT2rbEwAZsu/HI l1rEzw4FHpvB7wMTix5VMDzogBPpKMNa+XglLRf3Atn0GZYO4M8o3BPdUZHfCPXdYLY0 mVBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749676496; x=1750281296; h=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=uFUoBzQ6+vuOkFkBZSKFMXX6VCTYEVAzTjm5ZSGLmeY=; b=gTH7Xl9IhnOygxASQHKGZrSqEKtiJL7HYI79JN1rFjjPhWKvnjvoEw5zsByFZ6zV4+ NmdlunUvPe2YMnMHHEvNeOVIbFjrbaTE1eT4T9loweanM5Qk3TrQUs0LMUxcv2lmLDGw dQ4fwaN2NGfdjbRo2OBbM/PnkUXX2x2RVGlMvgePZqIplnCwqTrrVSXsQv5AWgj3mCO+ 9Foeo1eTpG4CmQfSP2FHBRrjlCvGeF0JkSeVJK6QttkNINMDPxt+UyqdUSY7mKfbEyD9 RDTYYvgC/j4/3Jwic/xK4wuujvuIGpPn4ZRpUNgctY2CyzpwuFABwSQ+nSk5IcmdRWEx Zipg== X-Forwarded-Encrypted: i=1; AJvYcCUYcCoCv0wXuyhaJCPnbqOOAkklsquwWScHgMbUpo4bleGMheKdQo/YvLxTngKVCLmQlUNYnW7XoX1rNZzx@lists.postgresql.org X-Gm-Message-State: AOJu0YxVs7WhPGB1jsEZL/YGiwRfoI91JSqsqWyow5oU66mxVSUQP5DB BiKq0pTCgTK4ccU0dXyasC+T6v3CRBEDgV6JwTM2WiLTEx1xYj00aUMV X-Gm-Gg: ASbGnctibDXgYdrHyYAcB6ESRXNhlckgrowiPsfTqKmRyyyuvVaygvAY4v9kCwUFwph BQ55rhGJoCSkOMG43jVXZZgjmcFVNw0GiBKSb/eYROKjLWWuQZaLLF2VPj+vKYHMjcUI51chSAV HB3RK2sn14ZDvobbzzr3Z+FWABd7/4JF8x/OiqXDpbqcci9PXr6hJGREYAM931VowW2hTF5G3QP TYr6HEuFuNxY5/Hhq0bKAERmy9eeiOV3kZ+OVuGP4ta118KwFg1yZyFtmWyyftnnttsioux/v5H pgMQdEZ64WavvtG/BTjZxwQQ+B5VYNQbEa2Y5XZ0EnettQ6Ph+Qw3AE4tJ4uqX13YkOamhoLHvF ih8ELGS361zz7bm5TXGyeLX5s5rJoIibkQ6iS+/E1HbpWDzYCMe5n X-Google-Smtp-Source: AGHT+IEqMq0kT7ICUjr+ZyhrSHyoyHTPigeGhn0m1wrUynT7IkMd/8ojevQKkvgiKIQYyuGERU4now== X-Received: by 2002:a05:6e02:1a41:b0:3dd:d90a:af30 with SMTP id e9e14a558f8ab-3ddf42c5dbemr51861305ab.10.1749676495896; Wed, 11 Jun 2025 14:14:55 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-3ddfbacf300sm212405ab.35.2025.06.11.14.14.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Jun 2025 14:14:55 -0700 (PDT) Date: Wed, 11 Jun 2025 16:14:53 -0500 From: Nathan Bossart To: Dimitrios Apostolou Cc: Tom Lane , pgsql-hackers@lists.postgresql.org Subject: Re: [PING] [PATCH v2] parallel pg_restore: avoid disk seeks when jumping short distance forward Message-ID: References: <2edb7a57-b225-3b23-a680-62ba90658fec@gmx.net> <1282067.1744651649@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Jun 11, 2025 at 12:32:58AM +0200, Dimitrios Apostolou wrote: > Thank you for benchmarking! Before answering in more depth, I'm curious, > what read-seek pattern do you see on the system call level (as shown by > strace)? In pg_restore it was a constant loop of read(4K)-lseek(8-16K). For fseeko(), sizes less than 4096 produce a repeating pattern of read() calls followed by approximately (4096 / size) lseek() calls. For greater sizes, it's just a stream of lseek(). For fread(), sizes less than 4096 produce a stream of read(fd, "...", 4096), and for greater sizes, the only difference is that the last argument is the size. -- nathan