Same name in this branch
  1. 6.x includes/database.pgsql.inc \db_add_index()
  2. 6.x includes/database.mysql-common.inc \db_add_index()
Same name and namespace in other branches
  1. 7.x includes/database/database.inc \db_add_index()
  2. 8.9.x core/includes/database.inc \db_add_index()

Add an index.

Parameters

$ret: Array to which query results will be added.

$table: The table to be altered.

$name: The name of the index.

$fields: An array of field names.

Related topics

20 calls to db_add_index()
comment_update_6003 in modules/comment/comment.install
Add index to parent ID field.
comment_update_6004 in modules/comment/comment.install
Add index to to node_comment_statistics on comment_count
comment_update_6005 in modules/comment/comment.install
Add indices to uid fields.
locale_update_6004 in modules/locale/locale.install
Fix remaining inconsistent indexes.
system_update_1022 in modules/system/system.install
Add index on users created column.

... See full list

File

includes/database.pgsql.inc, line 813
Database interface code for PostgreSQL database servers.

Code

function db_add_index(&$ret, $table, $name, $fields) {
  $ret[] = update_sql(_db_create_index_sql($table, $name, $fields));
}