Repository navigation
Description
Is there an existing issue for the same performance problem?
- I searched open and closed MatrixOne issues for Parquet LOAD DATA parallelism, row-group fanout, S3 Range amplification, and external Parquet performance.
- [Bug]: External Parquet ignores the batch byte budget and can materialize oversized batches #27895 concerns Parquet source-batch memory budgeting and is a separate problem.
Environment
- Branch:
main - Reproduction commit:
b7892451b3d3df7ca998d45a215d07b20c415ecb - Server version:
8.0.30-MatrixOne-v25908 - Client: macOS arm64, 10 logical CPUs
- Source: S3-compatible MinIO endpoint behind
nginx/1.25.5
Problem
For LOAD DATA ... format='parquet', omitting the PARALLEL clause leaves parallel loading disabled. The compiler only enables Parquet row-group fanout when param.Parallel is true, so a valid large Parquet object silently falls back to serial read/write unless the user knows to add:
PARALLEL 'true'High-latency S3-compatible storage then magnifies the cost of Parquet's fine-grained ReaderAt access pattern. A reproduced object has:
- Object size: 2,663,323,225 bytes (about 2.48 GiB)
- Rows: 74,986,259
- Columns: 16
- Row groups: 1,168
- Rows per group: about 63.8K to 65.7K
- Serialized footer: 2,138,002 bytes
The schema matches the target table, and the object has a valid Parquet footer. This is not a malformed-file or type-conversion failure.
Measurements
Observed on the same client-to-endpoint path:
| Probe | Result |
|---|---|
| MatrixOne Parquet LOAD DATA | about 0.78 MiB/s |
Direct mc contiguous 64 MiB read, bypassing MatrixOne |
91.9 s, about 0.70 MiB/s |
| Direct 4-way Range reads | about 0.79 MiB/s aggregate |
| Direct 10-way Range reads | about 0.83 MiB/s aggregate |
| Direct 64 KiB Range read | 1.16 s average |
| Direct 1 MiB Range read | 2.92 s average |
| Direct 4 MiB Range read | 5.15 s average |
| Independent PyArrow footer open | 9.29 s |
| Independent PyArrow single-row-group read | 11.4 to 18.7 s |
The object-store/network path is the primary throughput bottleneck in this reproduction: MatrixOne reaches approximately the same aggregate throughput as direct clients. However, the current default and read pattern are important amplifiers:
- Serial-by-default Parquet LOAD cannot hide high per-request latency.
- 1,168 row groups across 16 columns create many small Range reads.
- Reopening the same Parquet object in multiple scopes can repeat footer/schema access.
- Fine-grained Range calls make high-RTT MinIO/proxy paths disproportionately expensive.
At the observed throughput, reading the compressed object alone has a lower bound of about 54 minutes, before final decode, primary-key construction, write, and commit costs.
Expected behavior
- For
LOAD DATAwithformat='parquet', default to parallel row-group loading whenPARALLELis omitted. - Preserve
PARALLEL 'false'as an explicit opt-out with serial behavior. - Reduce S3 Range request count and latency amplification for files containing many small row groups and column chunks.
- Keep memory/read amplification bounded; do not solve request count by prefetching arbitrarily large objects.
- Preserve atomic rollback and error propagation across row-group scopes.
The default change should be scoped to Parquet LOAD DATA. External-table query semantics should only change if separately justified.
Candidate optimization directions
These are investigation directions, not a required implementation design:
- Reuse footer and schema metadata across row-group scopes for the same object.
- Prefer contiguous row-group assignment where it reduces disjoint Range access without creating severe load imbalance.
- Coalesce nearby column-chunk/page reads and slice the result locally.
- Add bounded read-ahead or a per-query shared Range cache for overlapping/adjacent reads.
- Avoid duplicate footer and magic-byte reads by each shard.
- Record Parquet profile metrics for footer reads, Range call count, requested bytes, fetched bytes, coalesced bytes, row groups, and read/decode/write time.
Acceptance criteria
- A Parquet LOAD without a
PARALLELclause takes the row-group fanout path when the file contains multiple non-empty row groups. - Explicit
PARALLEL 'false'remains serial. - Serial and default-parallel modes produce identical rows for fixed-width, variable-width, nullable, decimal, date, and string columns.
- NOT NULL/type-conversion/duplicate-key failures roll back the complete LOAD in default-parallel mode.
- Cancellation terminates every shard and leaves no partial rows.
- A deterministic instrumented file-service test demonstrates materially fewer Range calls for a many-small-row-group fixture.
- The optimization has explicit bounds for memory, fetched-byte amplification, concurrency, and per-query cache/read-ahead state.
- A benchmark reports Range calls, fetched bytes, wall time, and peak memory before and after the change.
- Small/local Parquet files do not regress materially.
Activity
perf(load): add opt-in parquet parallel-load groundwork (#27903)
perf(load): add opt-in parquet parallel-load groundwork (matrixorigin…
perf(load): add opt-in parquet parallel-load groundwork (matrixorigin…
perf(load): add opt-in parquet parallel-load groundwork (matrixorigin…