Guides
Handling Parquet Files
We run a simple aggregation query over Parquet files using different row group sizes, selected between 960 and 1,966,080. The results are as follows.  
<div class="narrow_table"></div>  
| Row group size | Execution time |
|---------------:|---------------:|
| 960            | 8.77 s         |
| 1920           | 8.95 s         |
| 3840           | 4.33 s         |
| 7680           | 2.35 s         |
| 15360          | 1.58 s         |
| 30720          | 1.17 s         |
| 61440          | 0.94 s         |
| 122880         | 0.87 s         |
| 245760         | 0.93 s         |
| 491520         | 0.95 s         |
| 983040         | 0.97 s         |
| 1966080        | 0.88 s         |  
The results show that row group sizes <5,000 have a strongly detrimental effect, making runtimes more than 5-10× larger than ideally-sized row groups, while row group sizes between 5,000 and 20,000 are still 1.5-2.5× off from best performance. Above row group size of 100,000, the differences are small: the gap is about 10% between the best and the worst runtime.  
#### Parquet File Sizes {#docs:guides:performance:file_formats::parquet-file-sizes}  
DuckDB can also parallelize across multiple Parquet files. It is advisable to have at least as many total row groups across all files as there are CPU threads. For example, with a machine having 10 threads, both 10 files with 1 row group or 1 file with 10 row groups will achieve full parallelism. It is also beneficial to keep the size of individual Parquet files moderate.  
> **Best practice.  ** The ideal range is between 100 MB and 10 GB per individual Parquet file.  
#### Hive Partitioning for Filter Pushdown {#docs:guides:performance:file_formats::hive-partitioning-for-filter-pushdown}  
When querying many files with filter conditions, performance can be improved by using a [Hive-format folder structure](#docs:data:partitioning:hive_partitioning) to partition the data along the columns used in the filter condition. DuckDB will only need to read the folders and files that meet the filter criteria. This can be especially helpful when querying remote files.  
#### More Tips on Reading and Writing Parquet Files {#docs:guides:performance:file_formats::more-tips-on-reading-and-writing-parquet-files}  
For tips on reading and writing Parquet files, see the [Parquet Tips page](#docs:data:parquet:tips).