Prev | Current Page 140 | Next

Emilian Balanescu and Cristian Darie

"Beginning PHP and MySQL E-Commerce: From Novice to Professional, Second Edition"


The drawback of indexes is that they can slow down database operations that add new rows
or update existing ones because the index must be actualized (or the table rows rearranged)
each time these operations occur.
You should keep the following in mind about indexes:
??? Indexes greatly increase search operations on the database, but they slow down operations
that change the database (delete, update, and insert operations).
??? Having too many indexes can slow down the general performance of the database. The
general rule is to set indexes on columns frequently used in WHERE, ORDER BY, and GROUP
BY clauses or used in table joins.
??? By default, unique indexes are automatically created on primary key table columns.
You can use dedicated tools to test the performance of a database under stress conditions
with and without particular indexes; in fact, a serious database administrator will want to run
some of these tests before deciding on a winning combination for indexes.
?– Note You learned about some data table properties in the previous pages. For more details about each of
them, refer to the MySQL online manual at http://dev.mysql.com/doc/ or Jason Gilmore??™s Beginning
PHP and MySQL 5: From Novice to Professional, Second Edition (Apress, 2006).
Creating the department Table
You created the tshirtshop database in Chapter 3. In the following exercise, you??™ll add the
department table to it using the phpMyAdmin web client interface.


Pages:
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152