Linux Today: Linux News On Internet Time.
Search Linux Today
Linux News Sections:  Developer -  High Performance -  Infrastructure -  IT Management -  Security -  Storage -
Linux Today Navigation
LT Home
Contribute
Contribute
Link to Us
Linux Jobs


Top White Papers

More on LinuxToday


Optimizing MySQL Query Retrieval Speed Through Table Joins

Dec 10, 2010, 22:34 (1 Talkback[s])
(Other stories by Rob Gravelle)

"A poorly optimized query can become the bottleneck in an otherwise highly optimized process. In many cases, the source of the slow performance is improper table joining in the WHERE clause. With that in mind, this article looks at ways to optimize table joins for speedy data retrieval.

"Novice query writers are quite content once they are satisfied that their query is retrieving the correct data. Beyond that, there comes the inevitable realization that it takes an unacceptable length of time for the query to come back with those results. In fact, a poorly optimized query can become the bottleneck in an otherwise highly optimized process. In many cases, the source of the slow performance is improper table joining in the WHERE clause. With that in mind, let's take a look at ways to optimize our table joins for speedy data retrieval.

"How MySQL Resolves Table Joins

"We've already seen in the Clearing a Path through the 3NF Join Jungle article that normalized databases can require a lot of joins to get at the desired data, lots and lots of joins! As you can imagine, the mechanism through which the database engine links the tables can greatly affect retrieval speed. Let's take a look at a simple three table query and see how MySQL scans them."

Complete Story

Related Stories: