Guides
Loading CSV Files
CSV files are often distributed in compressed format such as GZIP archives (` .csv.gz`). DuckDB can decompress these files on the fly. In fact, this is typically faster than decompressing the files first and loading them due to reduced IO.  
<div class="narrow_table"></div>  
| Schema | Load Time |
|---|--:|
| Load from GZIP-compressed CSV files (` .csv.gz`) | 107.1 s |
| Decompressing (using parallel `gunzip`) and loading from decompressed CSV files | 121.3 s |  
#### Loading Many Small CSV Files {#docs:guides:performance:file_formats::loading-many-small-csv-files}  
The [CSV reader](#docs:data:csv:overview) runs the [CSV sniffer](https://duckdb.org/2023/10/27/csv-sniffer) on all files. For many small files, this may cause an unnecessarily high overhead.
A potential optimization to speed this up is to turn the sniffer off. Assuming that all files have the same CSV dialect and colum names/types, get the sniffer options as follows:  
```sql
.mode line
SELECT Prompt FROM sniff_csv('part-0001.csv');
```  
```text
Prompt = FROM read_csv('file_path.csv', auto_detect=false, delim=',', quote='"', escape='"', new_line='\n', skip=0, header=true, columns={'hello': 'BIGINT', 'world': 'VARCHAR'});
```  
Then, you can adjust `read_csv` command, by e.g., applying [filename expansion (globbing)](#docs:sql:functions:pattern_matching::globbing), and run with the rest of the options detected by the sniffer:  
```sql
FROM read_csv('part-*.csv', auto_detect=false, delim=',', quote='"', escape='"', new_line='\n', skip=0, header=true, columns={'hello': 'BIGINT', 'world': 'VARCHAR'});
```