Month: January 2005

Auschwitz on PBS

Watched Auschwitz on PBS tonight. It is terrifying to see this happening, but a historical perspective must be jarred to reality by the knowledge that the over-arching goals of the extermination camps still apears in human activity.

Sometimes I wonder if we are fit to consider ourselves the primary species on this world.

The Problem with MySQL FULLTEXT Indices

Ok, know that I have discovered the beauty of FULLTEXT indices, I know have discovered their dark side: even set for "IN BOOLEAN MODE", I get way more results than I was expecting.

Using the logic of the FULLTEXT search, it makes total sense. If I pass "/compression/" as a variable to the listing page, it returns everything that matches that string, including the sub-pages.

Time to haul out a regular expression. Using PHP’s ereg function, I perform a case insensitive match on the string.

if (ereg("^$page$","$row[DATABASE_URL]")) {
        …
}

So I am skipping all of the overzealous returns, and displaying only the exact matches. And, believe it or not, this process is still far faster than using the REGEX engine in the MySQL query to start off with the exact matches.

If anyone has a less brain-damaged way to get MySQL to quickly return exact string matches, let me know.


Addendum: I found yet another brain-damaged thing with FULLTEXT searches: if you search to match against "/", exactly zero results are returned, even with "IN BOOLEAN MODE" turned off. This baffled me for a while, and is important enough for me to waste some mental energy on, as all requests for the root document in an Apache log file are referenced as "/".

After trying a few things, I actually had to write a corner-case "if" statement, that, if the passed URL exactly matches "/^/$/", use the REGEX method to pull the pages. All other pages are processed using FULLTEXT matching.

This behaviour is very weird.

Re-write of GrabPERF Data Insertion Process

I re-wrote the data inserting mechanism for the GrabPERF script. Previously, I had been looping through the measurements, then looping through the results to insert them.

Now I open two database connections, loop through the measurements and insert them after the data is collected. Much more efficient, although I am still a hack programmer.

I will be glad to share a sanitized version of the measurement script with anyone who asks.

The Beauty of FULLTEXT Indices

I insert all of my Web server hits into a MySQL database, and a few of the queries I run were really slow. Then I discovered that using FULLTEXT Searches, as opposed to LIKE or REGEXP, were far superior.

Cut the query time by 80%. Ouch.

If you use non-binary CHAR, VARCHAR, or TEXT columns, consider a FULLTEXT Index on those columns.

Canadian executives are slow to follow U.S. peers in setting up Web logs

Despite what some of my readers might think, the statement in the title is one I know, in my heart, to be true. Canadian CEOs are far more conservative and risk-averse than their US brethern, and there is no real cult of the CEO in Canada as there is in the US.

Canadian business culture is very chummy, and probably a little older than US business culture. This means that e-mail has just become a useful tool for many Canadian CEOs. IM and Blogs? Maybe in the next generation.

Thanks to the Blog Herald.

[A lack of] Project Management

Suddenly this weekend, a project at work, which had been back-burnered for all of Q3 2004, became a screaming hot topic to be completed ASAP.
This is not much of an issue, as the code that needs to be written will consist of re-using a group of functions that I have already developed and refined. What is curious is that they decided to expose the document used to define this specification to more than one customer. At the time of the initial scope definition for the project, this was to be for a partner who we had developed a contractual relationship with, including and SLA. Now management has decided that exposing this document to other customers, who can then also hold us to the same SLA, is a good idea.
Sometimes I wonder what I have gotten myself into.

Copyright © 2025 Performance Zen

Theme by Anders NorenUp ↑