Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use UNSIGNED INT for ip #1390

Closed
robocoder opened this issue May 28, 2010 · 3 comments
Closed

Use UNSIGNED INT for ip #1390

robocoder opened this issue May 28, 2010 · 3 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@robocoder
Copy link
Contributor

In hindsight, the switch to Unsigned BIGINT (#668) won't accommodate an ipv6 address (see #1111).

Using a 32-bit INT would save 4 bytes per row in the log visit table and improve performance on 32-bit systems.

@halfdan
Copy link
Member

halfdan commented May 28, 2010

Agreed, IPv6 would need 2xBIGINT, or alternatively DECIMAL(39,0) (http://www.koopman.me/2008/04/storing-ipv6-ips-in-mysql/)
Shouldn't this problem be adressed together with #1111?

@robocoder
Copy link
Contributor Author

Truncating the unsigned bigint to unsigned int should be minimal effort and we already have unit tests for the conversion to/from dotted decimal form. #1111 requires more effort.

@robocoder
Copy link
Contributor Author

(In [2236]) fixes #1390 - use UNSIGNED INT for ip; since the upper 32 bits is unused, the ALTER statement simply truncates to the lower 32 bits

@robocoder robocoder added this to the Piwik 0.6.3 milestone Jul 8, 2014
@robocoder robocoder self-assigned this Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

2 participants