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 1rAa6W-007GGJ-7F for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Dec 2023 18:25:08 +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 1rAa6U-005CQk-Th for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Dec 2023 18:25:06 +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 1rAa6U-005CQa-H8 for pgsql-hackers@lists.postgresql.org; Tue, 05 Dec 2023 18:25:06 +0000 Received: from mail-io1-xd2a.google.com ([2607:f8b0:4864:20::d2a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rAa6Q-00AGDg-Fe for pgsql-hackers@postgresql.org; Tue, 05 Dec 2023 18:25:05 +0000 Received: by mail-io1-xd2a.google.com with SMTP id ca18e2360f4ac-7b3871b5ff7so221040439f.3 for ; Tue, 05 Dec 2023 10:25:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701800700; x=1702405500; darn=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=YvVZRJDSG6JX6jMymf1ZJxKFSt4kHZpWZcLS4U6wu08=; b=GzgHjHz+bXAQmu68URlP3IWxFzxCq8Q1RceCBd7S0leFb99Iv2+kPnALudvbGYNPHH 9OJ9Qo6fMg+vblKg29lLXeL40+DOQ/A+q49x1bOfqFJ+u6bHLA/shFnP6geNqvQhyaEy Wbfa+VFD28HkZq3/QoYfkQF1OBZtu7ks5Tkpfcn9qylhTf5AmjYq0+plZNomwnRpC+8F HImeTyFiSFUOOty4tW/rb6onb4qjpUzniUMa9emgk/jbGIsNCSR5hNRbC6gzlN3+iF2H UuwFVGLK3b7xFYB7Zm0d2JT8x3hc6w27C+58BALauFZpAnov7r/7uHnR2Vr05rkITqPb ucEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701800700; x=1702405500; 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=YvVZRJDSG6JX6jMymf1ZJxKFSt4kHZpWZcLS4U6wu08=; b=eRDm2kkPAtSkX4LpoPUTHnBkkumTQ3hxJNewzpcAHQTJxNzbQAilBvcTPJVmScw1FJ eRt9j9JihdFEMcmfXCdiiK/ii3l12IOq8DoeZjs9FggeDc9hp8qbn6eRaY62W4HVG1tf k/vCxF+qAZxFJP6RmKTE17+AeL8qKIM7sfBnvZ9uRRQs3LgP5GdSH0IFP/mzJHBcoB3W ZlHS2r/OVztpoFp8HowAMQOUQQ3q3VwcNFeu61Is/3jYzJS6yapgk2aYiEDmYCLXCXhd 1L+jH9JhUfJheEkPt0Jcy9UGw7jD/nMc9l4RTVQy2bowDBTWIYcRTI3bwrhy2rk+TreO Lz5w== X-Gm-Message-State: AOJu0Yx1/Ci6Ixu8qCiwcA8eEVQH0tw6ZFlpWpm4t4PpVLoIlQIlnzvf c7TsqS/hdh127eQ9M0R7y8JrhRPID4U= X-Google-Smtp-Source: AGHT+IELzcxS8goL2mDYTUCCqT7HJ6u1OBQ1LRLsYoDN+yt9R640ONG32Ai9g/uzemTGdipGd9k5Og== X-Received: by 2002:a5d:9c54:0:b0:7b4:28f8:312f with SMTP id 20-20020a5d9c54000000b007b428f8312fmr6593492iof.35.1701800700577; Tue, 05 Dec 2023 10:25:00 -0800 (PST) Received: from nathanxps13 (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id m10-20020a056638270a00b00468f1305e4esm1993723jav.21.2023.12.05.10.24.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 10:25:00 -0800 (PST) Date: Tue, 5 Dec 2023 12:24:58 -0600 From: Nathan Bossart To: Sutou Kouhei Cc: pgsql-hackers@postgresql.org Subject: Re: Make COPY format extendable: Extract COPY TO format implementations Message-ID: <20231205182458.GC2757816@nathanxps13> References: <20231204.153548.2126325458835528809.kou@clear-code.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231204.153548.2126325458835528809.kou@clear-code.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Dec 04, 2023 at 03:35:48PM +0900, Sutou Kouhei wrote: > I want to work on making COPY format extendable. I attach > the first patch for it. I'll send more patches after this is > merged. Given the current discussion about adding JSON, I think this could be a nice bit of refactoring that could ultimately open the door to providing other COPY formats via shared libraries. > In other words, this is just a refactoring for further > changes to make COPY format extendable. If I use "complete > the task and then request reviews for it" approach, it will > be difficult to review because changes for it will be > large. So I want to work on this step by step. Is it > acceptable? I think it makes sense to do this part independently, but we should be careful to design this with the follow-up tasks in mind. > So I measured COPY TO time with/without this change. You can > see there is no significant loss of performance. > > Data: Random 32 bit integers: > > CREATE TABLE data (int32 integer); > INSERT INTO data > SELECT random() * 10000 > FROM generate_series(1, ${n_records}); Seems encouraging. I assume the performance concerns stem from the use of function pointers. Or was there something else? -- Nathan Bossart Amazon Web Services: https://aws.amazon.com