GeoParquet pipeline patterns that actually scale

Anyone have a solid reference architecture for exporting PostGIS to GeoParquet via Arrow Flight, landing in S3, then serving ad‑hoc reads through DuckDB/HTTP? I’m pushing a nightly batch of about 15M features with GDAL 3.8 in a K8s CronJob and I/O is the choke point; pointers to tuning flags, sample repos, or minimal stacks that worked in production would help?

‌⁠‍⁠​‍​‍‌⁠‌​​‍​‍​⁠‍‍​‍​‍‌‍‌⁠‌‍‌⁠‌‍‍‍​‍​‍​‍⁠​​‍​‍‌‍‍⁠​‍​‍​⁠‍‍​‍​‍‌‍⁠‍‌‍‌‌‌⁠‌⁠‌‌⁠⁠‌⁠‌​‌‍⁠⁠‌⁠​​‌‍‍‌‌‍​⁠​‍​‍​‍⁠​​‍​‍‌‍‍‌‌‍‌​​‍​‍​⁠‍‍​‍​‍‌‍⁠‍‌‍‌‌‌⁠‌⁠​‍​‍​‍⁠​​‍​‍‌‍‌​​‍​‍​⁠‍‍​‍​‍​⁠​‍​⁠​​​⁠​‍​⁠‌‍​⁠​​​⁠​‌​⁠​‍​⁠​‍​‍​‍​‍⁠​​‍​‍‌‍‍​​‍​‍​⁠‍‍​‍​‍‌​⁠‌‌⁠​‍‌‍⁠‍‌​‌‍‌‌‍​‌‍​⁠​‍⁠‌‌‍​⁠‌‌‍​‌‍⁠⁠‌⁠​‌‌‌‌‌​⁠​‌‌‌‌⁠‌‌‍‌‌‍‌‌​‍​‍‌⁠⁠‌​​

For the “I/O is the choke point”, the one tweak that moved the needle for me was pre-sorting features by a spatial key (we used H3) before writing and targeting about 128MB Parquet row groups with ZSTD, which cut DuckDB/HTTP range requests by about 3x; can you sort upstream in PostGIS and test on a shard?

‌⁠‍⁠​‍​‍‌⁠‌​​‍​‍​⁠‍‍​‍​‍‌‍‌⁠‌‍‌⁠‌‍‍‍​‍​‍​‍⁠​​‍​‍‌‍‍⁠​‍​‍​⁠‍‍​‍​‍‌⁠​‍‌‍‌‌‌⁠​​‌‍⁠​‌⁠‍‌​‍​‍​‍⁠​​‍​‍‌‍‍‌‌‍‌​​‍​‍​⁠‍‍​⁠‌‍​⁠​⁠​⁠​​​⁠​​​‍⁠​​‍​‍‌‍‌​​‍​‍​⁠‍‍​‍​‍​⁠​‍​⁠​​​⁠​‍​⁠‌‍​⁠​​​⁠​‌​⁠​‍​⁠‍‌​‍​‍​‍⁠​​‍​‍‌‍‍​​‍​‍​⁠‍‍​‍​‍​‍⁠‌‌‌‌‌‌‌‌‌​⁠‌‍​⁠‍‌‌‍‌​‌​‌‍​⁠‍‌‌⁠‌‌​⁠​​​‍⁠‌‌​⁠⁠‌‌‌‍​‍⁠‌​‍⁠‌‌‌​​​‍​‍‌⁠⁠‌​

Switching GDAL to build the Parquet locally and push it as one multipart upload to S3 helped most: set CPL_VSIL_USE_TEMP_FILE_FOR_RANDOM_WRITE=YES when writing to /vsis3/ and bump the multipart size per the docs (GDAL Virtual File Systems (compressed, network hosted, etc...): /vsimem, /vsizip, /vsitar, /vsicurl, ... — GDAL documentation). Are you writing straight to S3 from the CronJob? That tweak took our about 18M‑feature nightly from about 90m to about 35m.

‌⁠‍⁠​‍​‍‌⁠‌​​‍​‍​⁠‍‍​‍​‍‌‍‌⁠‌‍‌⁠‌‍‍‍​‍​‍​‍⁠​​‍​‍‌‍‍⁠​‍​‍​⁠‍‍​‍​‍‌⁠​‍‌‍‌‌‌⁠​​‌‍⁠​‌⁠‍‌​‍​‍​‍⁠​​‍​‍‌‍‍‌‌‍‌​​‍​‍​⁠‍‍​⁠‌‍​⁠​⁠​⁠​​​⁠​​​‍⁠​​‍​‍‌‍‌​​‍​‍​⁠‍‍​‍​‍​⁠​‍​⁠​​​⁠​‍​⁠‌‍​⁠​​​⁠​‍​⁠​​​⁠​⁠​‍​‍​‍⁠​​‍​‍‌‍‍​​‍​‍​⁠‍‍​‍​‍‌​​‌‌‍​‌‌​​⁠‌​⁠‌‌⁠​‍‌‍‌⁠‌‌‍‌‌‍‍‌‌‍⁠​‌⁠‌​‌​‍‌‌‌‌​‌​‍​​⁠‌⁠‌‌​‍‌​⁠⁠​‍​‍‌⁠⁠‌​