revenue has type
FLOAT. It should be
DECIMAL(11, 2) or similar.
Links to any studies? Performance tests? Other known problems?
0.1 + 0.2 != 0.3 in float.
And today I tried to get all conversions with revenue =
0.29, which was not possible in SQL using
Here's a stackoverflow thread about it: https://stackoverflow.com/questions/13030368/best-data-type-to-store-money-values-in-mysql
Since money needs an exact representation don't use data types that are only approximate like float.
Looks like 4 decimals places (to accommodate Chile) would suffice. https://en.wikipedia.org/wiki/ISO_4217
We can't address this issue prior Matomo 4.0, as we try to avoid any schema changes to log tables in minor releases...