Tagged articles
2 articles
Page 1 of 1
AI Illustrated Series
AI Illustrated Series
Feb 7, 2024 · Databases

Why Store IPv4 Addresses as UNSIGNED INT in MySQL? Space, Speed, and Queries Explained

Storing IPv4 addresses as a 32‑bit UNSIGNED INT instead of VARCHAR saves storage space, reduces index size, enables faster range queries, and leverages MySQL’s built‑in INET_ATON/INET_NTOA functions, while the trade‑offs include reduced readability and the need for conversion code, as demonstrated with benchmarks and Java examples.

INET_ATONIP address storageUNSIGNED INT
0 likes · 5 min read
Why Store IPv4 Addresses as UNSIGNED INT in MySQL? Space, Speed, and Queries Explained
Top Architect
Top Architect
Sep 19, 2021 · Databases

Why Store IPv4 Addresses as UNSIGNED INT in MySQL Instead of VARCHAR

The article explains that using a 32‑bit UNSIGNED INT to store IPv4 addresses in MySQL saves space, improves index and range‑query performance, and provides built‑in conversion functions, while also noting readability drawbacks and offering Java utilities for manual conversion.

INET_ATONIP address storageUNSIGNED INT
0 likes · 6 min read
Why Store IPv4 Addresses as UNSIGNED INT in MySQL Instead of VARCHAR