Thursday, February 28, 2008

Thursday

It seems I only post on Thursdays recently. I wonder why.

Due to a minor issue on a query at work yesterday, I got to learn a lot about how mysql indexing works. It was fun and interesting. In the end, I think the whole thing will be a non-issue, but at least I got to learn some neat stuff along the way. For instance, the order you put fields in an index matters, because any fields after the field being used to sort can't be used in where clauses. There are just a ton of little nuances like that.

In my home time I have been working with Erlang a bit. I'm still in the uber-nub stage with it, but I am trying to make some progress. After all, I have this glorious four core machine, and I should put it to use with something. Also, I think Erlang seems like an interesting niche with a lot of opportunities to build interesting things. The Ruby space has matured so nicely since I started with it in 2005, hopefully the Erlang space can too.

The two languages seem to compliment each other so well too. Ruby is just so great for doing things quickly, and now that it has so many libraries to do things, it makes a great exploratory tool. Erlang seems great for another type of exploration, which is back end performance. One of my first experiments with it was comparing a simple factorial algorithm with a parallelized one. The difference is quite mind-blowing. I mean, all I did was cheat and make it calculate fac(N-1), fac(N-2), and fac(N-3) in child nodes all at once. This is essentially akin to increasing the branching factor of the recursion tree from one to three. But it definitely put more cores to use and finished faster on bigger numbers.

Like I said, I haven't done anything too exciting with it yet, but I have an idea for a webservice framework that I'd like to build (for my own projects, and maybe for open source consumption). The basic vision is write something to map Yaws requests RESTfully to Mnesia records or some SQL db. The cool part would be seeing how well it scaled. I think I could get some people at hacker news to hammer it with a script for a while to see how it went.

Non-programming news in my life mostly includes taxes and the doing of. How fun!

1 comments:

harry said...

how does mysql indexing work?