388 Part III . Administration Figure 14-14: The (Hp web site)

388 Part III . Administration Figure 14-14: The OPTIMIZE TABLE statement in action Optimizing Queries MySQL performs many optimizations for queries and statements without the user having to be involved. These include processes like examination of clauses and statements to determine how they could be phrased in a more efficient manner, and rejection of some statements without running them if they are invalid. MySQL also performs background optimization of DISTINCT statements and JOIN statements. If this process is automated, what s your role? In the previous section I examined the EXPLAINstatement. The EXPLAIN statement can help you determine the indexes to use with a SELECTstatement. Useful indexes are the key to improving server performance when your database applications perform many reads. After the database has been populated, sorting the indexes within the database may be helpful. You can do this with the myisamchk statement. For example, to sort on the first index, issue the following command: myisamchk –sort-index –sort-records=1 Figure 14-15 shows the previous command when run against a few tables within the ecommerce database. The second attempt in the example fails because no indexes exist in the cardinfotable.
Searching for affordable and reliable webhost to host and run your web applications? Go to our java web server services and you will be pleased.

Leave a Reply