eBusiness Help
Free White Paper: Customer-Centric CRM; Fully Optimizing CRM
Learn to evolve your current CRM projects around a customer centric strategy
Try Looksmart PPC Search Marketing
$25 in Free Clicks for New Advertisers
45 Days Free Hosting From Rackspace
Move at your own pace and save with an 18 mo. contract

Free Software Archive:
Enterprise and Home Networking Downloads

Recent Articles

MySQL 5.0 Available For Production Use
MySQL AB announced the launch of MySQL 5.0 on Monday. The much-anticipated upgrade is available for download under the open source GPL license. The new version looks to be loaded with new features too.

Oracle Innobase Purchase Impacts MySQL
As reported in several sources Oracle has acquired Innobase Oy for an undisclosed sum of money.

MySQL 5.0 Release Candidate Available
It's been a long time coming but the wait is nearly over (and well worth it). If you haven't been following MySQL 5.0 development very closely ...

Microsoft Showing Off SQL Server 2005 At Gitex
The world's largest software company let the middle-eastern market take a gander at the SQL Server 2005 and their development tool, Visual Studio 2005, at the September edition of the Gitex conference in Dubai, UAE.

How to Use SQLXML to Retrieve Data From SQL Server Database?
Using SQL Server 2000 and above versions you can retrieve data from SQL Server in XML format directly from the database.

Performance Tuning of a Daffodil DB / One$DB -JDBC Application
This article illustrates the best practices to improve the performance of Daffodil DB / One$DB JDBC Driver.

Training Underway for Microsoft SQL Server 2005
Microsoft SQL Server 2005 is due to be released later this year, and training has already begun for IT professionals in preparation for it.

11.15.05


Programmer Overkill (MySQL)

By A.P. Lawrence

I have a peeve about MySQL. Oh, not about MySQL directly: it's great. I love it, it's wonderful, no complaints. It's the people who use it when they don't need to that get me shaking my head and talking to myself.

This falls in the same general category as my previous rant about text vs. binary. Some people use MySQL for idiotic purposes.

If you have a couple of hundred records to store, a database of any kind is just plain ridiculous. You can open that file and find anything by brute force far quicker than you can make a database connection and process a SELECT. Furthermore, the data is immediately available to any other program, to shell scripts, and to human beings with text editors.

To show that, I created a small MySQL database with 99 records and a text file to match. A Perl program reads through the text file and prints it out. The other Perl program does nothing but connect to the database, disconnect and exit. Here's the code:

# text version
#!/usr/bin/perl
open(I,"tst");
while( <I> ) {
chomp;
print "$_\n";
}

# mysql version
#!/usr/bin/perl5
use DBI;
$dbh=DBI->connect('DBI:mysql:foo:localhost','root','8k3t2s95', {PrintError=>1, RaiseError=>1}) or die "$DBI::errstr";
$dbh->disconnect;
exit 0;


Write 10,000 lines of code in 10 minutes!
Iron Speed Designer – Free Evaluation

The MySQL doesn't read a single record and prints nothing to the screen. Watch:

$ time mysqlversion.pl
real 0m0.187s
user 0m0.108s
sys 0m0.070s
$ time textversion.pl
foo, 1
foo, 2
foo, 3
...
foo, 97
foo, 98
foo, 99

real 0m0.020s
user 0m0.011s
sys 0m0.001s


The text version, which actually reads and prints all the records, takes about a tenth of just the startup time for the MySQL version.

So you say, sure, but that's just a hundred records. Let's try a thousand, shall we?

foo, 1
foo, 2
foo, 3
...
foo, 997
foo, 998
foo, 999

real 0m0.069s
user 0m0.005s
sys 0m0.016s


See what I mean? That's reading and printing one thousand records, and it still does it before MySQL is ready to do anything at all.

Again, it's not MySQL that's the problem. If you choose to drive an eighteen wheeler to pick up groceries, we can't blame the truck. Actually, if it were just you making that choice, I wouuldn't care, but when some otherwise nice piece of software insists upon using MySQL for no good reason, I get annoyed. And I mutter. And I rant here, of course.

*Originally published at APLawrence.com


About the Author:
A.P. Lawrence provides SCO Unix and Linux consulting services http://www.pcunix.com

About SQLproNews
SQLproNews is a collection of up to date tutorials and insightful articles designed to help SQL users of any skill level implement successful SQL systems and practices. SQL Strategies and Tactics for Business

SQLproNews is brought to you by:

SecurityConfig.com NetworkingFiles.com
NetworkNewz.com WebProASP.com
DatabaseProNews.com SQLProNews.com
ITcertificationNews.com SysAdminNews.com
SQLproNews.com WirelessProNews.com
CProgrammingTrends.com SysAdminNews.com



-- SQLProNews is an iEntry, Inc. publication --
iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509
2005 iEntry, Inc.  All Rights Reserved  Privacy Policy  Legal

advertising info | news headlines | free newsletters | comments/feedback | submit article

SQL Strategies and Tactics for Business SQLproNews News Archives About Us Feedback SQLproNews Home Page About Article Archive News Downloads WebProWorld Forums Jayde iEntry Advertise Contact