Index: database/database.mysql =================================================================== RCS file: /cvs/drupal/drupal/database/database.mysql,v retrieving revision 1.195 diff -u -r1.195 database.mysql --- database/database.mysql 30 Aug 2005 15:19:20 -0000 1.195 +++ database/database.mysql 7 Sep 2005 15:06:41 -0000 @@ -128,7 +128,9 @@ custom tinyint(2) DEFAULT '0' NOT NULL, throttle tinyint(1) DEFAULT '0' NOT NULL, visibility tinyint(1) DEFAULT '0' NOT NULL, - pages text NOT NULL + pages text NOT NULL, + PRIMARY KEY (module,delta), + INDEX (status,region) ) TYPE=MyISAM; -- Index: database/database.pgsql =================================================================== RCS file: /cvs/drupal/drupal/database/database.pgsql,v retrieving revision 1.134 diff -u -r1.134 database.pgsql --- database/database.pgsql 30 Aug 2005 15:19:20 -0000 1.134 +++ database/database.pgsql 7 Sep 2005 15:07:59 -0000 @@ -123,8 +123,10 @@ custom smallint NOT NULL default '0', throttle smallint NOT NULL default '0', visibility smallint NOT NULL default '0', - pages text NOT NULL default '' + pages text NOT NULL default '', + PRIMARY KEY (module,detla) ); +CREATE INDEX status_region ON blocks(status,region); -- -- Table structure for book Index: database/updates.inc =================================================================== RCS file: /cvs/drupal/drupal/database/updates.inc,v retrieving revision 1.129 diff -u -r1.129 updates.inc --- database/updates.inc 30 Aug 2005 15:19:20 -0000 1.129 +++ database/updates.inc 7 Sep 2005 15:15:22 -0000 @@ -44,7 +44,8 @@ "2005-07-30" => "update_143", "2005-08-08" => "update_144", "2005-08-15" => "update_145", - "2005-08-25" => "update_146" + "2005-08-25" => "update_146", + "2005-09-07" => "update_147" ); function update_110() { @@ -778,6 +779,21 @@ return $ret; } +function update_147() { + $ret = array(); + + if ($GLOBALS['db_type'] == 'mysql') { + $ret[] = update_sql('ALTER TABLE {blocks} ADD PRIMARY KEY (module,delta)'); + $ret[] = update_sql('ALTER TABLE {blocks} ADD INDEX (status,region)'); + } + elseif ($GLOBALS['db_type'] == 'pgsql') { + $ret[] = update_sql('ALTER TABLE {blocks} ADD PRIMARY KEY (modules,delta)'); + $ret[] = update_sql('CREATE INDEX status_region ON {blocks}(status,region)'); + } + + return $ret; +} + function update_sql($sql) { $edit = $_POST["edit"]; $result = db_query($sql);