https://github.com/si3nloong/sql-toxic-queries
Benchmark on toxic queries
https://github.com/si3nloong/sql-toxic-queries
benchmark go sql toxic-query
Last synced: about 1 year ago
JSON representation
Benchmark on toxic queries
- Host: GitHub
- URL: https://github.com/si3nloong/sql-toxic-queries
- Owner: si3nloong
- Created: 2022-06-27T14:30:00.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-10-15T03:02:15.000Z (over 2 years ago)
- Last Synced: 2025-03-26T05:33:20.209Z (about 1 year ago)
- Topics: benchmark, go, sql, toxic-query
- Language: Go
- Homepage: https://sianloong90.medium.com/go-beyond-sql-27baf2e0e9d8
- Size: 20.3 MB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Toxic Queries
> This is an experiment to test how slow can a toxic query be.
## Setup
Machine: Macbook Pro
CPU: M1 Max
Memory: 32GB
OS: macOS Monterey
Record set: 500,000
## Benchmarks
| Statement | Operation |
| ---------------------- | --------------- |
| COUNT with \* | 0.009784 ns/op |
| COUNT with Primary Key | 0.01063 ns/op |
| COUNT with Explain | 0.0001766 ns/op |
| Statement | Operation |
| ---------------------- | ------------- |
| LIKE with Leading % | 0.1275 ns/op |
| LIKE without Leading % | 0.09251 ns/op |
| Statement | Operation |
| ----------------------- | ------------------ |
| Offset Based Pagination | 204339916750 ns/op |
| Cursor Based Pagination | 1339252750 ns/op |
| Statement | Operation |
| ---------------------------- | --------------- |
| INSERT with Stored Procedure | 0.0002593 ns/op |
| INSERT | 0.0001896 ns/op |