Custom Fields
Support MB Custom Table Covering indexes Reply To: Covering indexes


Anh Tran

Hi David,

When you create a table, you can set which column(s) are indexed. Just put the columns you want to index in the last param of MB_Custom_Table_API::create function.

For example, this code will index the column email:

MB_Custom_Table_API::create( 'my_custom_table', array(
    'address' => 'TEXT NOT NULL',
    'phone'   => 'TEXT NOT NULL',
    'email'   => 'VARCHAR(20) NOT NULL',
), array( 'email' ) );

See the docs for more info.

If you want to do that manually with raw SQL, you can do that via a tool like phpMyAdmin.