diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-02-18 15:14:11 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-02-18 15:14:11 +0000 |
commit | df591c8f4032041613192e1b7836725f92ea7b10 (patch) | |
tree | 9f10ec2d4649e4681219a18fc175f6b8d865d00e | |
parent | 953c7bdea1f6474fff482257777713ccef93313c (diff) | |
download | brdo-df591c8f4032041613192e1b7836725f92ea7b10.tar.gz brdo-df591c8f4032041613192e1b7836725f92ea7b10.tar.bz2 |
#215080 by drifter and robertDouglass: Add index on system name and type to speed query.
-rw-r--r-- | modules/system/system.install | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/modules/system/system.install b/modules/system/system.install index 9300d758d..a584c68b3 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -1179,7 +1179,7 @@ function system_schema() { 'type' => array( 'description' => 'The type of the item, either module, theme, or theme_engine.', 'type' => 'varchar', - 'length' => 255, + 'length' => 12, 'not null' => TRUE, 'default' => '', ), @@ -1217,7 +1217,8 @@ function system_schema() { ), 'primary key' => array('filename'), 'indexes' => array( - 'modules' => array(array('type', 12), 'status', 'weight', 'filename'), + 'modules' => array('type', 'status', 'weight', 'filename'), + 'type_name' => array('type', 'name'), ), ); @@ -3213,6 +3214,18 @@ function system_update_7018() { } /** + * Shorten the {system}.type column and add an index on type and name. + */ +function system_update_7019() { + $ret = array(); + db_drop_index($ret, 'system', 'modules'); + db_change_field($ret, 'system', 'type', 'type', array('type' => 'varchar', 'length' => 12, 'not null' => TRUE, 'default' => '')); + db_add_index($ret, 'system', 'modules', array('type', 'status', 'weight', 'filename')); + db_add_index($ret, 'system', 'type_name', array('type', 'name')); + return $ret; +} + +/** * @} End of "defgroup updates-6.x-to-7.x" * The next series of updates should start at 8000. */ |