Skip to content

[PERF]: Cache parquet metadata at the session level #23526

Description

@Matt711

Problem

prefetch_parquet_file_metadata_for_ir fetches parquet footers from S3 at the start of every query execution, even for files that were already read in a previous iteration of the same benchmark or a previous query against the same dataset. The CachedParquetInfo objects (which include the parsed FileMetaData and pre-built HybridScanMetadata, and open kvikio handles as of #23317) are discarded when the query finishes.

From profiling Q1 at SF300 on a g7e.8xlarge:

Image

It takes a second to prefetch the parquet metadata on both iterations. But the second iteration should not pay that cost.

Proposed Fix

Add a session-level cache of CachedParquetInfo objects on the engine. Key the cache on (path, etag) where the etag is the S3 object version identifier propagated from polars via #22734.

Related

Metadata

Metadata

Assignees

Labels

PerformancePerformance related issuecudf-polarsIssues specific to cudf-polars

Type

No type

Projects

Status
No status
Status
Todo
Status
No status
Status
Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions