db_add_index

Versions
6
db_add_index(&$ret, $table, $name, $fields)
7
db_add_index($table, $name, $fields)

Add an index.

Parameters

$table The table to be altered.

$name The name of the index.

$fields An array of field names.

Related topics

▾ 23 functions call db_add_index()

comment_update_7003 in modules/comment/comment.install
Improve indexes on the comment table.
comment_update_7006 in modules/comment/comment.install
Create user related indexes.
comment_update_7007 in modules/comment/comment.install
Split {comment}.timestamp into {comment}.created and {comment}.changed.
comment_update_7008 in modules/comment/comment.install
Add language column to the {comment} table.
comment_update_7010 in modules/comment/comment.install
Add {node_comment_statistics}.cid column.
dblog_update_7002 in modules/dblog/dblog.install
Add index on uid.
field_sql_storage_field_storage_update_field in modules/field/modules/field_sql_storage/field_sql_storage.module
Implement hook_field_storage_update_field().
filter_update_7000 in modules/filter/filter.install
Add a weight column to the filter formats table.
forum_update_7000 in modules/forum/forum.install
Add new index to forum table.
locale_update_7000 in modules/locale/locale.install
Add context field and allow longer location.
node_update_7002 in modules/node/node.install
Extend the node_promote_status index to include all fields required for the node page query.
system_update_6049 in modules/system/system.install
Replace src index on the {url_alias} table with src, language.
system_update_6052 in modules/system/system.install
Add a missing index on the {menu_router} table.
system_update_6053 in modules/system/system.install
Add a {system} index on type and name.
system_update_7008 in modules/system/system.install
Use the poll_choice primary key to record votes in poll_votes rather than the choice order. Rename chorder to weight.
system_update_7018 in modules/system/system.install
Shorten the {system}.type column and modify indexes.
system_update_7025 in modules/system/system.install
Improve indexes on the {url_alias} table.
system_update_7030 in modules/system/system.install
Add an index to node_comment_statistics on comment_count.
system_update_7031 in modules/system/system.install
Add a missing index on the {menu_router} table.
system_update_7032 in modules/system/system.install
Alter field hostname to identifier in the {flood} table.
system_update_7042 in modules/system/system.install
Rename dst and src to source and alias.
system_update_7045 in modules/system/system.install
Add expiration field to the {flood} table.
update_fix_d7_requirements in includes/update.inc
Perform Drupal 6.x to 7.x updates that are required for update.php to function properly.

Code

includes/database/database.inc, line 2501

<?php
function db_add_index($table, $name, $fields) {
  return Database::getConnection()->schema()->addIndex($table, $name, $fields);
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.