Opened 4 years ago

Closed 4 years ago

#1390 closed Bug (fixed)

Use UNSIGNED INT for ip

Reported by: vipsoft Owned by: vipsoft
Priority: normal Milestone: Piwik 0.6.3
Component: Core Keywords:
Cc: Sensitive: no

Description

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.

Change History (3)

comment:1 Changed 4 years ago by halfdan

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?

comment:2 Changed 4 years ago by vipsoft (robocoder)

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.

comment:3 Changed 4 years ago by vipsoft (robocoder)

  • Resolution set to fixed
  • Status changed from new to closed

(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

Note: See TracTickets for help on using tickets.