Archive for August, 2006

Indexing Really Helps

Thursday, August 31st, 2006

Today I needed to modify a relatively simple, single table selection query in my web app to include left join with another table. One table holds info about submitted reports, while the other has the results of an evaluation form for a given report. The whole application started as just a very basic online evaluation form. Then I got a request for some sort of online submission mechanism. Initially they just wanted an upload page, but I built in a tracking system to go along with it. They liked it so much that they now decided to join the two.

I needed to show which reports were evaluated and which were not. The way my tables are structured, this is essentially a basic left join. Each table has almost a thousand rows in it, so I was expecting a major slowdown. No matter what you do, that Cartesian product necessary to do a join just kills performance-wise. I ran a test query to see exactly how painful is this going to be:

SELECT report.id, report.name, eval.id, eval.reportid
FROM report LEFT JOIN eval
ON report.id=eval.reportid

The result: 802 rows in set (13.44 sec). Painful! 13 seconds is unacceptable. People whine that the application is slow as it is.

Luckily though, I could fix this! Indexing is your friend!

ALTER TABLE eval ADD INDEX(reportid);

I re-ran the same exact query, only to see: 802 rows in set (0.02 sec).

Wohoo! This is a world of difference! Looking at this improvement, I’m planning to carefully examine all the big queries and put indexes on pivotal columns to optimize the db processing time. If I can shave off few seconds here and there, the overall user experience may improve.

Unfortunately the speed bump that most of my users experience is not the query time, but the crappy IE rendering engine. It just can’t handle rendering a large HTML table (20 columns by 50-100+ rows) without temporarily locking up the UI. Firefox users don’t even notice this issue because gecko renders the page incrementally.

Any good ideas how to optimize displaying large HTML tables in IE? I was thinking about just using span elements (or some sort of XML makup) and css to space out text on the page. It could potentially render a little bit faster than a table. Worse comes to worse, I’ll just start generating tab delimited output surrounded by <pre> tags.

I’m currently working on a feature that will dump a report into an Excel file so that they can play around with the numbers. This could be another potential solution.

Does Sen. Stevens have an OFF button?

Wednesday, August 30th, 2006
Ted The Tubes Stevens

I think Senator Ted “The Tubes” Stevens is on a quest to become the most hated and ridiculed person on the internets. Apparently he is the guy who put the super-doubleplus-secret hold on the bill that would open up federal spending records to the public.

Stevens is a a liability – a corrupt politician from a backwater state who will push a horribly unpopular, damaging net neutrality bill, and secretly derail useful legislation without any regard for the public interest or even his own reputation. Will anyone vote for “the tubes” guy in the next election? Who the hell knows – he is from Alaska. Apparently the tubes over there freeze over in the winter so they don’t get much internet connectivity anyways. :P

The point is – he is on his way out, he already clowned himself, was ridiculed on national TV, and became an internet legend. He has nothing to loose at this point, but he still holds the office, and has political power. If you want to push some unpopular agenda, or stage some career damaging political stunt (like doubleplus secret holds) he is your guy!

This is why we need to watch his hands really closely now and see who is pulling his strings. He will be the for all kinds of crazy shit now, but I bet you that someone else is benefiting from all of his shenanigans.

Update Thu, August 31 2006, 09:22 PM

Zefrank devotes the whole episode of The Show to this issue. Strangely, he makes no tubes jokes.

Alex Cherry – Deviant Monkeys

Tuesday, August 29th, 2006

Check out this sick deviant art gallery. I really like this guys style. I would describe it as hauntingly awesome, but then again I’m no art critic. All I know is that this is going to be my new desktop wallpaper:

Monkeys

click for full size

I said it before, and I’ll say it again: Monkeyz Frinken Rule! :mrgreen:

Here is Alex Cherry’s official website. Go check it out.