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 1sIb1o-00GjSX-QO for pgsql-hackers@arkaria.postgresql.org; Sat, 15 Jun 2024 21:33:41 +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 1sIb0m-00HQd3-NV for pgsql-hackers@arkaria.postgresql.org; Sat, 15 Jun 2024 21:32:37 +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 1sIb0l-00HQcv-JV for pgsql-hackers@lists.postgresql.org; Sat, 15 Jun 2024 21:32:37 +0000 Received: from mail.clear-code.com ([153.126.206.245]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sIb0h-001rUA-KG for pgsql-hackers@lists.postgresql.org; Sat, 15 Jun 2024 21:32:35 +0000 Received: from localhost (unknown [IPv6:2404:7a80:89c1:1200:6af9:2266:1443:f149]) by mail.clear-code.com (Postfix) with ESMTPSA id 7D0EE1A2FE4; Sun, 16 Jun 2024 06:32:22 +0900 (JST) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.clear-code.com 7D0EE1A2FE4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=clear-code.com; s=default; t=1718487142; bh=+xt2CxlLhkKjawQ0q5nQ0oxcR2BjLuO8Ta0j/IOVTKg=; h=Date:To:Cc:Subject:From:In-Reply-To:References:From; b=mgG3WRwN0g1arbdf027gRwubdoUe/tmapKYK0eiXvABnJ/KRTPzQAhRyIo+q6O91Q nK80pOlNz77q+P67E+VzxSzOPBeroMi0fg7MEY4+0tHxMphAwizB3UWt3SDY3WmrND P8DynTEIvULUKp6+8oXZLR1tAtlfcnY8+F1QvmkQ= Date: Sun, 16 Jun 2024 06:32:20 +0900 (JST) Message-Id: <20240616.063220.999225191405879719.kou@clear-code.com> To: sushrut.shivaswamy@gmail.com Cc: pgsql-hackers@lists.postgresql.org Subject: Re: Columnar format export in Postgres From: Sutou Kouhei In-Reply-To: References: <20240613.092134.184277386367461532.kou@clear-code.com> X-Mailer: Mew version 6.8 on Emacs 29.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [1.40 / 999.00]; MID_CONTAINS_FROM(1.00)[]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_ZERO(0.00)[0]; FREEMAIL_TO(0.00)[gmail.com]; TAGGED_RCPT(0.00)[]; ASN(0.00)[asn:2518, ipnet:2404:7a80::/29, country:JP]; ARC_NA(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; TO_DN_NONE(0.00)[]; SURBL_MULTI_FAIL(0.00)[localhost:server fail,postgresql.org:server fail] X-Rspamd-Server: mail.clear-code.com X-Rspamd-Action: no action X-Rspamd-Queue-Id: 7D0EE1A2FE4 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, In "Re: Columnar format export in Postgres" on Thu, 13 Jun 2024 22:30:24 +0530, Sushrut Shivaswamy wrote: > - To facilitate efficient querying it would help to export multiple > parquet files for the table instead of a single file. > Having multiple files allows queries to skip chunks if the key range in > the chunk does not match query filter criteria. > Even within a chunk it would help to be able to configure the size of a > row group. > - I'm not sure how these parameters will be exposed within `COPY TO`. > Or maybe the extension implementing the `COPY TO` handler will > allow this configuration? Yes. But adding support for custom COPY TO options is out-of-scope in the first version. We will focus on only the minimal features in the first version. We can improve it later based on use-cases. See also: https://www.postgresql.org/message-id/20240131.141122.279551156957581322.kou%40clear-code.com > - Regarding using file_fdw to read Apache Arrow and Apache Parquet file > because file_fdw is based on COPY FROM: > - I'm not too clear on this. file_fdw seems to allow creating a table > from data on disk exported using COPY TO. Correct. > But is the newly created table still using the data on disk(maybe in > columnar format or csv) or is it just reading that data to create a row > based table. The former. > I'm not aware of any capability in the postgres planner to read > columnar files currently without using an extension like parquet_fdw. Correct. We still need another approach such as parquet_fdw with the COPY format extensible feature to optimize query against Apache Parquet data. file_fdw can just read Apache Parquet data by SELECT. Sorry for confusing you. Thanks, -- kou