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 1pYAZO-0004gM-Ef for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Mar 2023 18:55:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pYAZN-0003AK-9T for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Mar 2023 18:55:53 +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 1pYAZM-0003AA-RO for pgsql-hackers@lists.postgresql.org; Fri, 03 Mar 2023 18:55:52 +0000 Received: from mail-il1-x12f.google.com ([2607:f8b0:4864:20::12f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pYAZK-0006a2-Cd for pgsql-hackers@postgresql.org; Fri, 03 Mar 2023 18:55:52 +0000 Received: by mail-il1-x12f.google.com with SMTP id k9so1758865ilu.13 for ; Fri, 03 Mar 2023 10:55:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; t=1677869748; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=LOVnat4oj0sOpHIleB/gjSQVB6Kx1Wh346pif2BNTOU=; b=kLjEWtVYbTlaq9RoVpeV2zP6Q7wOeOtoHq1X+F2sJSELvBWPVWHluai56AUxJieXrA 7YCaWGz7JIfg3bq42lCZSt+8zpc93sBQib2Mzpuup51Yc9mgpNGKhxQhcEUGWYVfFQDk Jxm2y2NzQ+LXsR4e7RPT9cuJpqSvNGIDXVkA34ARSQ6aHTSulel+pYRxhw3sO584z6B7 EsHSQ7Vu7nbtfY98ZdzRfQKbA1WvI/IqgGczcq4qtttTdwfDcm5W7cQI5M1K4oivnsVU /Muwx1BD0H8UpCS8VEgHKLaTdnimPFgPM3w6CD80TD8B0qPQEyGWkjnztRBL5uGYXXnd 1x7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677869748; h=user-agent:in-reply-to:content-transfer-encoding :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=LOVnat4oj0sOpHIleB/gjSQVB6Kx1Wh346pif2BNTOU=; b=Vlv3tsX+AM56EH2q80slMFHx6cTIlC3gAJe5vNJVQdaazPYlGmxxjzCe5IJcVUYsmk cjSW+hrXiMxhpZazc0bbftEVt50VHjvUR33PMJR8gm7M/d1m4y/ypAJ9U6Ib1w2xmiA7 tt8uDvNQBE5BF8DVtD7+Hkot6t2hZcM9pe/bh397lLaapDWJ8+kDfOjlXkgDJ78mBmdJ 5cdDCtNsUqtEBmNOFx+54oZR+Ohpfi4PAxrs10CPTOe9puTLyPqN/mFgXNKvx0nTw7EE SH8YdL2G5q4gL6wprONe/XimJ4b5YEMg/gUxKCaSeF7I9A07C9polKZkvhf+dSLBIhEe MOdg== X-Gm-Message-State: AO0yUKXY+o/ddrjHGzjHkLUsihvSa+1ItgtedTGEzQvxxAtXStgri1DC 1W31VVcrDnMhJB548T386yISFA== X-Google-Smtp-Source: AK7set9JCUewEkVhD78zIXURk1f7vH2ngRkfTRzCW97OULIeKWJUmGdtEAadksww2VWhuj6EwzGETQ== X-Received: by 2002:a05:6e02:1ba8:b0:313:ce4b:a435 with SMTP id n8-20020a056e021ba800b00313ce4ba435mr2425392ili.25.1677869748335; Fri, 03 Mar 2023 10:55:48 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id i2-20020a02ca42000000b003b8708902c0sm965092jal.21.2023.03.03.10.55.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Mar 2023 10:55:47 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id CE213800A8D; Fri, 3 Mar 2023 12:55:46 -0600 (CST) Date: Fri, 3 Mar 2023 12:55:46 -0600 From: Justin Pryzby To: Jacob Champion Cc: pgsql-hackers@postgresql.org, gkokolatos@pm.me, Michael Paquier , Tomas Vondra , Robert Haas , Peter Geoghegan , Peter Eisentraut , Heikki Linnakangas , Thomas Munro , Dipesh Pandit , Andrey Borodin , Mark Dilger Subject: Re: zstd compression for pg_dump Message-ID: <20230303185546.GE12850@telsasoft.com> References: <20230224191840.GD1653@telsasoft.com> <20230226012227.GK1653@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Mar 03, 2023 at 10:32:53AM -0800, Jacob Champion wrote: > On Sat, Feb 25, 2023 at 5:22 PM Justin Pryzby wrote: > > This resolves cfbot warnings: windows and cppcheck. > > And refactors zstd routines. > > And updates docs. > > And includes some fixes for earlier patches that these patches conflicts > > with/depends on. > > This'll need a rebase (cfbot took a while to catch up). Soon. > The patchset includes basebackup modifications, which are part of a > different CF entry; was that intended? Yes, it's intentional - if zstd:long mode were to be merged first, then this patch should include long mode from the start. Or, if pgdump+zstd were merged first, then long mode could be added to both places. > I tried this on a local, 3.5GB, mostly-text table (from the UK Price Thanks for looking. If your zstd library is compiled with thread support, could you also try with :workers=N ? I believe this is working correctly, but I'm going to ask for help verifying that... It'd be especially useful to test under windows, where pgdump/restore use threads instead of forking... If you have a windows environment but not set up for development, I think it's possible to get cirrusci to compile a patch for you and then retrieve the binaries provided as an "artifact" (credit/blame for this idea should be directed to Thomas Munro). > With this particular dataset, I don't see much improvement with > zstd:long. Yeah. I this could be because either 1) you already got very good comprssion without looking at more data; and/or 2) the neighboring data is already very similar, maybe equally or more similar, than the further data, from which there's nothing to gain. > (At nearly double the CPU time, I get a <1% improvement in > compression size.) I assume it's heavily data dependent, but from the > notes on --long [2] it seems like they expect you to play around with > the window size to further tailor it to your data. Does it make sense > to provide the long option without the windowLog parameter? I don't want to start exposing lots of fine-granined parameters at this point. In the immediate case, it looks like it may require more than just adding another parameter: Note: If windowLog is set to larger than 27, --long=windowLog or --memory=windowSize needs to be passed to the decompressor. -- Justin