sql vs. sql

Once again, UPHPU has had a minor stir about which database is faster / better / stronger, PostgreSQL or MySQL. All fanboyism aside, who really cares?

You want to know the way to *really* speed up your database? Normalization is probably going to be the largest factor. After that, use views, stored procedures, indexes, transactions and well-written queries, and your database is going to fly amazingly fast.

At work we have a large server we call “Zeus” because it is incredibly large. I won’t even go into specs because you wouldn’t believe me even if I told you. When I first started working here, the database running on it was incredibly slow. At first I blamed it all on the database software we are using (you can search my blog if you really wanna know which one it is. Hint: it’s neither of the two mentioned above), but as we cleaned up the databases and tables by removing columns that were complete cruft and then doing everything I mentioned above, this puppy flies. In fact, our “dev” database, which is running on nothing more than an Athlon XP 1800+ runs just as fast as our beast-monster does.

That’s how you get a fast database — doing things the right way. Who would have thought?

I have to apologize for the elitist feel of this post, but my point is this … the only magic bullet in improving performance is going to be quality code and design. Just replacing your database with something else isn’t going to make the speed fairy sprinkle your application with love.

Advertisements

a small comics trip

This entry is going to be a short little ditty since I’m at home being sick, and I can’t really think straight. I did want to at least get a small note up about this, though.

I read Scott McCloud’s online webcomic of “Hearts and Minds” today. I’ve been meaning to finish reading that for a while now. My timeline might be whacked, but I swear I remember when he first put that online, though that doesn’t seem to jive just right, since I would have been in Argentina at the time. But, whatever.

It was great stuff, though. I used to have the Zot books, volumes one and two, once upon a time. I probably sold them off in one of those phases of life where I was either completely broke or just cleaning out everything. I wish I had a copy, now.

That got me thinking about how much I used to be into comics, though. Man, was I ever. My favorites are the old EC Comics reprints of the sci-fi and horror stories. If you read too many of them though, the lettering starts to really bother you.

I grew up on comic books though. The first graphic novels I started reading were the Sandman series (gosh, that was a long time ago), but those were a little too graphic for me — I have a really low threshold for gore and bloody violence. I haven’t really picked up any since. I should find some.

I’ve got a box full of some old Gold Key comics I started collecting about a year ago. The Walt Disney ones are great stories. Nothing they’re putting out today compares, although that’s not saying much. Even for their time, though, the stories were better than anything else they had going in any other medium (I’m talking about movies).

I also discovered some Twilight Zone comics which are great, pretty much in the same vein as the EC comic books, but these are actually a tad more extreme in some cases. Still, they are a real treat. Great stories, cool colors.

I gotta get back into getting some comics again. The great thing about it is it gets me into *reading* which I never do, anyway. There’s just so much good stuff out there, too. Craziness.

nova

For the first time in my life, I saw an episode of Nova on PBS last night. It was great. Nova is one of those things that I always knew I would enjoy if I ever sat down and figured out when it was on and then watched it. Hey, it only took me 18 years to get to that one.

The show was pretty awesome, though. The title of the episode was “Elegant Universe” or something like that, and it was about how Einstein wanted to believe very badly that deep down the universe can be explained in an orderly fashion. The show covered all kinds of stuff like gravity, electromagnetics, string theory, physicists from the early 1900s, and quantam mechanics. Very cool stuff.

For the record, I’m a real PBS junkie, too. I’ve got basic cable at home (only $12/mo, woots) and I get about thirty channels or so. Thankfully, Utah has about four public television shows (UEN, KBYU, KUED, and I know I’m forgetting something else … BYUTV maybe?) and there’s always something worth watching on one of them. It’s great.

Here’s some random stuff I picked up:

  • Einstein was a bit of a star in his younger days
  • String theory believes that there is an explanation that covers everything (I think)
  • Gravity is very weak compared to electro-magnetism, and on the atomic level is almost completely non-existant
  • Quantum mechanics deals with measuring the probability of certain outcomes, since nothing is ever certain.  Einstein refused to believe that because he couldn’t accept that on the smallest level that things were disorderly.

do you ever get the feeling …

… that no matter how much stuff you know, there is still a ton of stuff you don’t know?

Case in point, I’ve been working on writing ebuilds tonight, and it can be some incredibly difficult stuff.

First I started working on an ebuild for the wis-go7007 kernel drivers. Talk about biting off more than you can chew. I have to use the kernel eclasses, and I was looking at nvidia-kernel as a reference, but I couldn’t figure out why it was using eerror to get the output of linux_chkconfig_module.

The next one that I worked on (dev-libs/libebml) was changing something in the Makefile for Mac OS, and I had no flipping clue what it was changing or why. I’ll have to ping flameeyes on that one when he gets back.

Another one (media-video/oxine) has a lot of stuff to check for to make sure the deps were built correctly, and I couldn’t think of a good way to exit out if it was missing some without setting a bash variable.

On a good note, the one for mkvtoolnix came together great. That, and I fixed my alsa settings so my speakers don’t clip anymore.

I’m still bummed, though. I really need to learn more bash, it seems. I’ve been putting off learning other languages for a very long time now, since I’ve been so proficient in PHP, and now it’s really starting to bite me in the butt for not branching out.

*moop*

I’m gonna go get on my laptop, sit on my couch, crack open my awesome C++ book, and get learning. I figure if I could learn both extremes (C++ pretty hard, PHP pretty easy) then the stuff in the middle should make a lot more sense, right?

random passwords

I needed to write a random password generator today, and instead of bothering to search for some code that I could copy and paste, I just whipped up my own real quick.

Then I got thinking about how all those Perl monks brag about how they can cram all this code into as few lines as possible, so I crammed mine into just one line. :)

Here it is:

for($x = 0, $password = ”, $password_len = rand(8,24), $alphabet_range = range(‘A’, ‘z’); $x < $password_len; $x++) { $password .= $alphabet_range[rand(1, count($alphabet_range) – 1)]; }

The great thing is it spits out cool passwords like this:

  • luhRDKyMDX\oey
  • rbKGTt`dLHWkHQZ
  • LJyeO_UwTpQzIni
  • ltonXGkho[e\JWbBl^uyEL

Fun stuff. :D

more cowbell: planet larry

Introducing Planet Larry, an aggregation of blogs of Gentoo users. :)

A few of us in User Relations came up with the idea to have a planet feed that pulled subscriptions of blogs from our users that have anything to do with Gentoo. It’s not an official project, but that’s okay, it’s still just as cool. What we’d like to do is get anyone who writes about computer-related stuff and also uses Gentoo onto the feed. It’ll be a good way to see what you guys are up to, and at the same time hopefully bring the community together a little bit more.

So, if you use Gentoo and you blog, e-mail me your name and your blog’s website at beandog at gentoo dot org, and we’ll get you added. It’s that simple. :)