2 ms·
switching to log-space is insanely useful for compounding returns. inside mysql, i used it all the time. for example, perhaps i want to get a sense of the dis
by joshu 17y ago
switching to log-space is insanely useful for compounding returns.
inside mysql, i used it all the time.
for example, perhaps i want to get a sense of the distribution of users; i have a table "users" with columns "user" and "count"
i could get a log-scaled histogram like so:
select pow(int(log(count)/log(10)),10) as bin, count(*) as ct from users
this would get a table like such (forgive my ascii art)
bin | ct
----+---
1 | 12
10 | 27
100 | 35
another thing you can do is us the order of magnitude with repeat(char, num) to make a sort of visual bar chart.
that said, i'm sorta glad i don't have to use mysql professionally anymore.