Thursday, 14 May 2009

SELECTing SELECT statements for Wordpress MU blogging statistics

Sometimes I miss the coding I did last century. Today I was reminded of some of the fun, when I had set my mind to doing some statistics on my blogging.

In a blog entry on I describe what I did.

The blog entry may be of interest for those who use WordPress and are set back by the huge amounts of tables it generates. I happen to host 18 blogs and with each blog requiring 8 tables, that's a total of 144 tables. Add the 9 top-level blogs and I've got 153 tables to navigate.

The blog entry I wrote 

  • identifies the key fields

  • shows how to do stats on individual blogs

  • creates a statistics table into which I aggregate relevant entries from individual blog tables

  • uses SELECT to generate SELECT statements

  • and ends up with some statistics on the 253 blog entries in my WordPress.

I also studied the wp_n_comments tables, and came to the conclusion that I'll need to use some global DELETEs to clean up spam comments that have found their way to my site.

I found out that, strangely enough, I haven't approved a single comment that includes the character string "viagra"

select comment_approved,count(*)
from wp_4_comments
where comment_content like "%viagra%"
group by comment_approved;

The same applies to "cialis".

So I issued

delete from wp_4_comments 
where comment_content like "%cialis%";

delete from wp_4_comments
where comment_content like "%viagra%";

but I still have quite a bit of cleaning up to do, since despite deleting first 759 cialis entries and then 411 viagra entries, I still have 3683 unapproved comments to clean up (and I suspect there are less than 10 real comments that have slipped my attention in my inbox, when I've got notification of them).

At any rate, I got my statistics and had more efficient and fun (albeit incomplete) spam cleaning than ever before!

Tuesday, 12 May 2009

How do MySQL users keep track of digital pictures?

On my non-MySQL blog, I just wrote a blog post called "Photo Manager: How do you keep track of your pictures?". I'm looking for Open Source Software that helps me keep track of my 100,000+ digital pictures. I wrote specs on dreamt-up software called “Robfat” (for rename, order, backup, find, archive, tag) as I want to remove excess fat from my HDs (and CD/DVD cabinets).

And then I thought this may have a MySQL dimension:

What if we had an "EXIF Storage Engine"? What if we could update EXIF tags directly from the MySQL command line, with UPDATE statements, and SELECT picture file names based on tags and other file characteristics?

But beyond this technical aspect, I think many, many MySQL users are avid photographers and may have input about the specs themselves, or even know of existing software that satisfied the needs.

So please go to the blog post and comment!

Wednesday, 6 May 2009

Presenting and blogging in Chinese

Travelling to Hongkong and Taipei has made such an impression on me, that I couldn't help but add two new blogs to my homepage

Guanxi means "relations", as in "Community Relations". It's also a very common word describing how to get things done in China. It even has its own English language Wikipedia entry.

Yi-ling-yi means one-oh-one, as in Taipei 101. This number sequence also means "special" in Chinese. Taipei 101 is the world's highest completed skyscraper. Needless to say, that merits another Wikipedia entry, not to mention a blog entry in Traditional Chinese.

Tomorrow, I'll make another attempt at giving a short MySQL speech in Mandarin. Well, technically speaking, it's already today, as it's 3:30am in Taipei. My internal clock has gone awry.

Tuesday, 28 April 2009

On the Merits of Voting

Just before the MySQL User Conference, Dups implemented a small little feature for Planet MySQL: "voting". We wanted to see what a voting system might mean to you, our PlanetMySQL readers.

The question is now how to improve the voting mechanism to make it more useful. The goal is for everyone to see what you and your peers think are the best PlanetMySQL entries over a given week.

Here are some of the options:

1. Open up voting to everyone regardless of whether they are logged in or not. Currently you can only vote if you are logged in with a account. Let's face it, a login gives a barrier to entry even as much as it gives us the security of knowing we won't get spammed.

One option is to allow all to vote, within the constraints of spam control of some kind. Another option is to have voting for non-logged in users to count, but count less than those who login. This gives voters the incentive to login and magnify their voice, but allows anyone to have a vote if they choose not to login. An example would be to have a logged in vote worth 1 and a non-logged in vote worth 0.1

The problem, of course, is that we would be setting an artificial "quality" judgement on your vote.

2. We add voting links into the RSS Feed itself, so you can tell the world what you think of blog posts from within your RSS reader. We could also automate a posting of the Top voted entries on PlanetMySQL at the end of each week in case you decide not to come to the web site at all (though we hope you do come by once in a while).

3. We leave it as is!

Now it's your turn to tell us what you think! Remember the intent of all this is for good posts to not just disappear as the feeds scroll by with ever more content.

We've also been asked whether there is any conspiracy to throw posts up and down by us manipulating votes. Let me answer categorically: No. We do not manipulate the votes in any way. What you vote is what you see.

Sunday, 26 April 2009

The Future of MySQL

What is the future of MySQL? This is a question that interests many.

To be specific: Will there be significant performance improvements? Code contributions? Bug fixes? New features? Open Source licensed documentation? Will the users be happy with the Monthly Rapid Updates now released for the MySQL Community Server?

On another, more competitive level: Will there be successful forks? What will the MySQL AB founders do? What is Percona's next move?

Julian Cash, known for his visionary photography, extended his scope during a Wednesday session at the MySQL Conference. Hard work during his predictive session gave me insight. I now know the answers.

However, I'm afraid I cannot share the revelations on this blog. What I can do, though, is to point to Julian Cash's site "The Human Creativity Project", and to the visible results of his other sessions on Wednesday.

Thank you Julian!


Thursday, 23 April 2009

The Great Open Cloud Shootout: Videos and other links

Today's Great Open Cloud Shootout was great fun -- at least for me! I had the pleasure to tease these distinguished gentlemen with cloudy questions:

  • Lew Tucker, Cloud CTO, Sun Microsystems

  • Monty Taylor, MySQL Drizzle Geek, Sun Microsystems

  • Jeremy Zawodny, MySQL hacker, craigslist

  • Chander Kant, CEO, Zmanda

  • Thorsten von Eicken, CTO, RightScale

  • Prashant Malik, Cassandra Dude, Facebook

  • Mike Culver, Evangelist, Amazon Web Services

I tried to provoke the panelists with questions around some areas I had thought out:

  • So, what is a cloud anyway?

  • Who is the cloud for?

  • Why use the cloud?

  • Cloud adoption barriers

  • Are there cloud standards?

  • Cloud Business Opportunities

  • Cloud Competition

  • Databases & Clouds

UPDATE: Here is a list of web resources on the shootout:

Judging from the nods and agreements between the panelists, the term "shootout" may have been a tad more aggressive than necessary to describe the discussion. But that didn't seem to disturb twitterers. I'm very glad to have got positive Twitter comments such as

  • andygrove73: Excellent cloud shootout at the MySQL conference. Would have liked to hear discussion about sharding on the #cloud though.

  • imsplitbit: RT @LenzGr: Great #cloud discussion at #mysqlconf, @sheeri is next. I agree, that was the best shootout I have been to.

  • imsplitbit: If you are at #mysqlconf and are not at the Cloud Panel discussion you are missing out! Not to mention LAME! #cloud

  • LenzGr: "Cloud not suitable for money laundry" (Monty Tailor in the #cloud shootout at #mysqlconf)

  • sheeri: RT @LenzGr: Love the pictures in Kaj's slide deck of the #cloud panel discussion #mysqlconf 

I'm grateful to Steve Curry for coming up with the idea to this keynote. Thank you! 

I also wanto to extend a big Thank you to all our panelists, and to the audience -- I hope you had as fun as I did!

Here are some more of Zack Urlocker's pictures (the first picture on top, in the rain-protective hat, is by Duncan Davidson): 

Tuesday, 21 April 2009

Karen's Commitments to the MySQL Community

A new start always provides an opportunity to reassess your way of doing things:

  • “Am I doing the right things with my life?”

  • “Which habits could I change -- in order to be a better neighbour?” 

Since Karen Tegan Padir took over the MySQL product from Mårten Mickos, we at Sun have taken a thorough look in the mirror.  The result of this introspection allows us to publish our conclusions and new community commitments this week in conjunction with the MySQL Conference & Expo in Santa Clara. 

For those who don't yet know Karen, let me state a few facts: 

  • Karen is VP of Sun's newly-founded MySQL & Software Infrastructure group

  • She describes herself as a geek and a straight-shooter, and I can attest to both 

  • She was deeply involved in Sun's decision to acquire MySQL, as well as the subsequent integration work throughout 2008 

Karen Tegan PadirIn my previous blog, "MySQL Culture and Business Philosophy Goes Mainstream at Sun", I stressed that the key point to remember is that Sun is completely committed to building a big open source-based business, and very much supportive of the various communities that Sun is engaged in. That may sound a bit abstract, so I have worked with my new boss, Karen, to spell out for the MySQL community what it actually means in practice: 

First: We shall now start releasing MySQL Community Server binaries as frequently as we release the MySQL Enterprise Server. We want everyone – community and customers -- to get the best bits first from us. This is why future Monthly Rapid Updates of MySQL 5.1 will remain available for the community. Moreover, future MRUs of MySQL 5.0 will also become available for the community. 

Second: We shall focus even more on our traditional core product values of stability, Performance and Ease of Use. Like you, we hate bugs, we hate slow, we hate waiting for fixes, and we hate awkward usability -- even more than we love new functionality. The MySQL 5.4 performance release, which is considerably faster than MySQL 5.0 or 5.1 in most use cases, is a case in point.

Third: We shall allocate additional resources to the health and well-being of the MySQL Community. We focus both on users and developers. We shall now devote a greater portion of our internal MySQL Engineering Team resources to reviewing and eventually merging architecturally-compatible features written by external contributors, even if those features weren't on our own roadmap.

Finally, fourth: We shall do more to improve our internal software engineering practices. We will brush our teeth every morning and evening, exercise several times a week, and eat (mostly) healthy food. Some of us may at times still take a vodka shot, but if so, then only to be social and to provide an excuse for singing badly, but not while writing code. 

In the spirit of open-ness, please give us ideas on how we can implement these changes. Let the MySQL community team know what you think. For those at the show this week, stop Karen in the halls and introduce yourself. Above all, enjoy!