Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kGQxh-0002H9-BX for pgsql-hackers@arkaria.postgresql.org; Thu, 10 Sep 2020 18:06:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kGQxf-0001Yf-CP for pgsql-hackers@arkaria.postgresql.org; Thu, 10 Sep 2020 18:06:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kGQxf-0001YY-2h for pgsql-hackers@lists.postgresql.org; Thu, 10 Sep 2020 18:06:19 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kGQxc-0005vl-No for pgsql-hackers@lists.postgresql.org; Thu, 10 Sep 2020 18:06:18 +0000 Received: by mail-wr1-x442.google.com with SMTP id o5so7791933wrn.13 for ; Thu, 10 Sep 2020 11:06:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=6o726r2e5yIncNY+rjhG6iOIflUZJyjt2fnHM1CfBpk=; b=ljr6aGT2Xl72GB0UJg7OP68TUzsKPaXdOpF/nbCbDbMKY/6B2IjiBbBDNFxAs79AO6 /nQZ/Oz01fnHfK+e8AdNVD47sO6Wb++t6/I98rfULwr9QBtzPSVLt9gq7LyRM9gmxFYR kG/dLlKkmBESTJv8gHrAPW+bwTYylER1M/eSX2poPyKbfbYVjlYKAuS40HB7ZNjcwC3r 9fBThAMx9QyOht2L04ksOB+fnAOWl1gsl2gPrmNlv6XijL8YEAUS4xYYgxhReM+HFefe PIhJyiZbwo/u/WZv+klJLir+jPvTTnEHDvpS3PUe8HuP6PQkcjyvoTkl2Clgl8mFsdYX ryIg== 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=6o726r2e5yIncNY+rjhG6iOIflUZJyjt2fnHM1CfBpk=; b=O0u5Hff0Hv0OanCjZGmVRN0FivjLl/jaCdibLKdviMrETsuuCh4MHEqU3lyP6HgFSE memmBLSi+w64DmAAwzDBYhAfFW4rmGWZowwzlkYYpjI/ekKRPlI8KzCPpP8E4XKinef6 qCh99uBBakZqM4NLJv4U/AdXAH7RWdYRqoKQSY7Kl32Ohulv+Gv/G5DzWEFyPcaa/wiu mXrXc4yxCYpcV39UfmeOX6e1GL0sfDm48DpK6PnAdz+eMFsJBAwWvNbg1LAkkjBHMRNb 4o599UhZmBYOSvqeJpfN9u0LlLFUX0d7acKWPTlslpGdelGKB4cvpchXReYj8RmPGHqM FqwA== X-Gm-Message-State: AOAM533aYl1fK1K/1C8R3aV2JyS/8e7EidRFqVGLvNONQFLNp6mhos1j ZSTs1OR8Dq8cw4T/7+YR5Jg= X-Google-Smtp-Source: ABdhPJwbbAO5cRMKNZTTK2xfm0CidbuOZ29v+Gu/VGy4Il1112rbmxNj2YK+coMXY1XB5vcBTRCpdA== X-Received: by 2002:adf:9e06:: with SMTP id u6mr10278298wre.208.1599761175726; Thu, 10 Sep 2020 11:06:15 -0700 (PDT) Received: from nol (82-64-124-11.subs.proxad.net. [82.64.124.11]) by smtp.gmail.com with ESMTPSA id y5sm9782822wrh.6.2020.09.10.11.06.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 11:06:14 -0700 (PDT) Date: Thu, 10 Sep 2020 20:06:10 +0200 From: Julien Rouhaud To: Michael Paquier Cc: Justin Pryzby , Masahiko Sawada , Robert Haas , PostgreSQL Hackers , Masahiko Sawada Subject: Re: Online checksums verification in the backend Message-ID: <20200910180610.GA62228@nol> References: <20200405094459.GG1206@nol> <20200712173403.GI26220@telsasoft.com> <20200714090808.GA20780@nol> <20200907065858.GC4867@paquier.xyz> <20200907085038.GA19261@paquier.xyz> <20200909092524.GC57691@nol> <20200909134130.GA29325@nol> <20200910074723.GA91494@nol> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200910074723.GA91494@nol> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, Sep 10, 2020 at 09:47:23AM +0200, Julien Rouhaud wrote: > On Wed, Sep 09, 2020 at 03:41:30PM +0200, Julien Rouhaud wrote: > > On Wed, Sep 09, 2020 at 11:25:29AM +0200, Julien Rouhaud wrote: > > > > > > I'll do some becnhmarking and see if I can get some figures, but it'll probably > > > take some time. In the meantime I'm attaching v11 of the patch that should > > > address all other comments. > > > > I just realized that I forgot to update one of the Makefile when moving the TAP > > test folder. v12 attached should fix that. > > > And the cfbot just reported a new error for Windows build. Attached v13 should > fix that. I did some benchmarking using the following environnment: - 16MB shared buffers - 490MB table (10M rows) - synchronized_seqscan to off - table in OS cache I don't have a big machine so I went with a very small shared_buffers and a small table, to make sure that all data is in OS cache but the table more than an order bigger than the shared_buffers, to simulate some plausible environment. I used a simple read only query that performs a sequential scan of the table (a simple SELECT * FROM table), run using 10 concurrent connections, 5 runs of 700 seconds. I did that without any other activity, with a \watch of the original pg_check_relation function using \watch .1, and a modified version of that function without the optimisation, still with a \watch .1 The TPS is obviously overall extremely bad, but I can see that the submitted version added an overhead of ~3.9% (average of 5 runs), while the version without the optimisation added an overhead of ~6.57%. This is supposed to be a relatively fair benchmark as all the data are cached on the OS side, so IO done while holding the bufmapping lock aren't too long, but we can see that we already get a non negligible benefit from this optimisation. Should I do additional benchmarking, like dropping the OS cache and/or adding some write activity? This would probably only make the unoptimized version perform even worse.