MySQL Usage Accounting

Those of you who use MySQL in a multi-user environment are probably disappointed by it’s lack of per user usage statistics. For example in Linux there are BSD process accounting for CPU usage and IO accounting for disk usage tracking. Most applications like apache, ftp servers and mail servers provide some sort of usage statistics as well. But MySQL is the great anonymizer.

Not anymore, thanks to the people at Percona for their microslow patch and Google for the UserTableMonitoring patch.

Latest version of the patches can be found here but at the time of this writing they are against MySQL 5.0.62 and the current MySQL version is 5.0.67. So I tweaked the patches to apply cleanly to MySQL 5.0.67 and placed them for download: microslow, userstats, microslow+userstats.

Going DSLR

We (me and Antonia) have finally decided to go the DSLR way. We were considering the switch for some time but only recently the pros of the current DSLR technology started to outweigh the cons for us.

We are proud owners of a Canon Powershot A95 compact digital camera for about 3 years and are generally very satisfied with it. Some of the main advantages of the compact digital cameras include:

  • Lightweight - A95 is not the lightest one at about 330 g but still only a half of the 2005’s lightest DSLRs.
  • Compact - you can carry it in your pocket.
  • Automatic shooting modes and various scene modes for point-and-shoot simplicity.
  • Live preview on a tilt LCD - none of the 2005’s DSLRs provided live preview and even though the current models do provide live preview it’s not nearly as useful as A95’s is.
  • Much cheaper than DSLR.

In November 2007 we were on a business trip to the USA and a friend of ours asked us if we could buy a Nikon 40D for her. You know - electronics are much cheaper in the US than in Europe. So we bought it and used it for few weeks while we were staying in Boston. It turned out DSLRs got cheaper, lighter and even my wife, who don’t want to know too much technical details about photography and prefers point-and-click interfaces, liked it. And the main selling points for us were:

  • Excellent low light/high ISO performance. This one is quite annoying with A95 and we have lots of blurry and noisy low light pictures.
  • No shutter lag. It’s instant. No more “oh, could you please stand still one more second please” or shots that include only the cat’s tail.

There are more SLR advantages that come as a bonus to the two above:

  • High degree of manual control.
  • Wide range of interchangeable lenses. Some are very expensive though.
  • Lenses are often high quality and produce images that are sharp and have a wide dynamic range.
  • Precise focus.
  • Higher frame rate.
  • More control over depth of field.

And some of the biggest disadvantages that were there in 2005 have improved significantly. For example Canon EOS 450D, aka Digital Rebel XSi, weights only 475 g (body only). A DSLR with comparable specifications weighted at least 700 g back in 2005.

So we decided to buy a Canon EOS 450D aka Digital Rebel XSi. It’s the latest incarnation of the Canon’s Digital Rebel line and some of the more notable improvements in comparison to 400D are:

  • Larger 3.0″ LCD monitor.
  • Live View.
  • Spot metering
  • Improved auto-focus.
  • 3.5 fps continuous shooting.
  • Larger viewfinder.
  • Display of the ISO sensitivity on the viewfinder status line.

We are waiting for our shiny new Digital Rebel to arrive from the US. Without any lenses so far because we are going to test first what kind of lenses will suit us best. Thanks to my brother Dave who has a rather extensive collection of Canon compatible lenses and is willing to borrow us some of them for test ride.

Weight Up, Weight Down

I remember when I was younger, I could eat almost anything that didn’t run away fast enough. Especially in my late teenage years I often ate all kind of junk food and often in quite large amounts. At the same time I wasn’t a very active kid. That’s not to say I stayed home all day long. I was going out with friends, walked for several kilometers each day as this was my main mode of transportation, swam occasionally. But I didn’t play football as many of my friends did and wasn’t involved in any other sports. In spite of all this I was staying fairly lean and fit. In general I didn’t think about nutrition, calories, weight etc. Yeah, it’s different when you’re growing up…

I’m 185 cm tall and up to my twentieth year I’ve never weighed more than 86 kg. Then in the last six months of my compulsory military service, which were very boring, I started to gain weight. My unit was carrying out a sentry service and there weren’t much things to do except taking charge of the posts or resting. After my discharge from the army I went up by another 2-3 kg. That’s when I decided I should take countermeasures. I restricted my food intake and also bought myself a bicycle. I was thinking about using it for transportation for some time anyway. This turned out to be enough and I was again at 86 kg in just few months. I enjoyed my bike through the summer and part of the autumn but when the temperatures fell bellow zero grades centigrade I left it at home.

There’s little room for outdoor physical activity in the big city during the winter and there are a lot of holidays as well. Quite often the days from 24 Dec to 1 Jan are non-working and we just stay at home and eat these delicious dishes prepared around the Christmas and New Year celebrations. That’s how I woke up at 103 kg on the 1st of January 2003. It was time for more drastic measures.

At first I severely restricted my food intake. I didn’t change what I was eating at all - just the quantities. I replaced the big pizza with a small one, 3 slices of bread with 1 slice and so on. Strangely (at least it was strange for me back then) these measures almost didn’t help so I included some physical activities. Mostly cardio like jogging, biking and only occasional push-ups or pull-ups… With a lot of effort I managed to go down to about 91 kg but the mirror wasn’t happy. Having the knowledge I acquired since then I think that’s because I lost too much muscle mass together with the fat by not eating enough and doing mainly cardio exercises. And the worst thing - after the summer was gone and I lifted the food restriction and abandoned exercises I regained my weight up to 100 kg in just few months.

At the beginning of 2006 as I was at my 99 kg mark again I finally realized that I don’t really know what I’m doing. It was about time to sit and do some serious research about how does the human metabolism work. I had spent years studying computer systems and at the same time I knew very little about how does my body work. Okay, perhaps nobody knows exactly all the aspects of how does the human body work. It’s a stunningly complex system and there’s a lot of controversy about what’s good for your health and what’s not. But anyway I had to look at the available knowledge and try to take some educated decisions about what to do next.

After about a month of research I decided to stick with Low Carb, High Fat diet (LCHF) and Resistance Training. This turned out to be an excellent choice so far. Two years and a half have passed - I eat mostly LCHF, most of the time I don’t watch my calories, unfortunately I don’t exercise very regularly - and I weigh 87 kg and my body fat is about 15% on average. I got a cholesterol profile about a year ago and the results were excellent. So I highly recommend this way of eating and training to everyone.

In later posts I’ll get into more details, and show you what I did to lose weight and what were the exact results.