Prev | Current Page 109 | Next

Marc Delisle

"Mastering phpMyAdmin 2.11 for Effective MySQL Management"


Index Management
phpMyAdmin has a number of index management options, which we will cover in
this section.
Single-Field Indexes
We have already seen how the Structure panel offers a quick way to create an index
on a single field, thanks to some quick links like Primary, Index, and Unique. Under
the field list, there is a section of the interface used to manage indexes:
This section has links to edit or delete every index. Here, the Field part lists only one
field per index, and we can see that the whole field participates in the index because
there is no size information after each field name??”contrary to what will be seen in
our next example.
We will now add an index on the title. However, we want to restrict the length of
this index to reduce the space used by the on-disk index structure. The
Create an index on 1 columns option is appropriate, so we click Go. In the next
screen, we specify the index details as shown in the following screen:
Chapter 6
[ 109 ]
Here is how to fill in this panel:
Index name: A name we invent
Index type: We can choose INDEX or UNIQUE
Field: We select the field that is used as the index, which is the title field
Size: We enter 30 instead of 100 (the complete length of the field) to
save space
After saving this panel, we can confirm from the following screenshot that the index
is created and does not cover the whole length of the title field:
Multi-Field Indexes and Index Editing
In the next example, we assume that in a future application we will need to find the
books written by a specific author in a specific language.


Pages:
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121