Skip to content

somosprte/benchmark-mysql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Benchmark MySQL

Description

This application benchmarks MySQL query performance using DuckDB and Parquet files with Golang.

Features:

  1. Query performance in MySQL:

    • Executes a query directly on the MySQL database and measures execution time.
    • Generates a Parquet file with the query results.
  2. Query performance in Parquet files using DuckDB:

    • Reads the Parquet file generated from MySQL data and executes SQL queries on it using DuckDB.

Installation

Prerequisites

  1. Install Go (v1.23.3 or higher): Download here.
  2. Install DuckDB (optional for external verification): Download here.
  3. Have access to a MySQL database.

Steps

  1. Clone the repository:

  2. Install the dependencies:

    go mod tidy

Run

go run main.go

Build

If you want to build the application, put the .env file in the same directory as the binary file.

For Windows:

GOOS=windows GOARCH=amd64 go build -o out/benchmark-mysql.exe main.go

For Linux:

GOOS=linux GOARCH=amd64 go build -o out/benchmark-mysql main.go

For MacOS:

GOOS=darwin GOARCH=amd64 go build -o out/benchmark-mysql main.go

Results

Duckdb is five times faster than MySQL for the same query.

Parquet files are a good compression format for data storage and can be used to improve query performance. 116235 rows where stored in a 2.881MB file.

Releases

No releases published

Packages

No packages published

Languages