Skip to content

1000x slowdown opening parquet file due to partitions #16676

Closed

Description

@asayers

Describe the bug

parquet metadata load time was 15 seconds with default configuration. Setting target_partitions to 1 brought it down to 15 milliseconds.

With the default config I was seeing 20 file groups in the DataSourceExec (since my machine has 20 cores) and loading the metadata was taking forever. Forcing target_partitions to 1 fixed it: I now see just 1 file group in the DataSourceExec, metadata load time is down. (Added bonus: the plan no longer requires a MergeExec, which was the slowest part of the whole query).

To Reproduce

The query I was running is very basic: just filter + sort + select. The parquet file is 130.00 MiB
with 1.08 MiB of metadata (6.42 MiB when expanded in memory).

Expected behavior

I wouldn't have thought going from 1 file group to 20 would slow down metadata parsing by 1000x.

Additional context

No response

Activity

  1. jatin510 commented on Jul 5, 2025

    @jatin510
    Contributor

    take

  2. asayers commented on Jul 6, 2025

    @asayers
    Author

    I think the correct solution was for me to enable the metadata cache (I haven't confirmed this). So perhaps the "bug" (if there is one) is just that the metadata cache is off by default?

  3. alamb commented on Jul 7, 2025

    @alamb
    Contributor

    Perhaps this is related to the default value of statistics too:

    #16447

    Do you have a reproducer you can share @asayers ?

  4. asayers commented on Jul 8, 2025

    @asayers
    Author

    I can't share the data I was hitting this case with. I could try to make a synthetic reproducer, but work is very busy right now so I might not get to it for a few months.

  5. alamb commented on Aug 14, 2025

    @alamb
    Contributor

    We have added a new metadata cache (will ship in 50.0.0):

    I wonder if you could try your reproducer with what is on main and see if the query runs faster

  6. alamb commented on Nov 26, 2025

    @alamb
    Contributor

    I think this issue should now be closed. Please reopen if it you don't see any improvement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions