From: Robert Treat Date: Mon, 6 Jul 2009 01:07:38 +0000 (-0400) Subject: add support for concurrent index builds X-Git-Tag: REL_5-0-BETA-1~97 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=a14fcf2a8d106779e6b62d91aea2b20001789c2c;p=phppgadmin.git add support for concurrent index builds --- diff --git a/HISTORY b/HISTORY index ad9df0fb..fb727aa2 100644 --- a/HISTORY +++ b/HISTORY @@ -16,6 +16,7 @@ Features * Support for Column Level Privileges * Allow users to specify a template database at database creation time * Support killing processes +* Add ability to create indexes concurrently Bugs * Fix problems with query tracking on overly long queries diff --git a/TODO b/TODO index 444fba58..b7990df7 100644 --- a/TODO +++ b/TODO @@ -120,7 +120,6 @@ Indexes * Support 8.1 Reindex [Database|System] commands * Expressional indexes -* Allow indexes to be built concurrently [8.2] * Create Index Asc/Desc, Nulls First/Last [8.3] diff --git a/classes/database/Postgres.php b/classes/database/Postgres.php index 7f42dd89..9571b108 100755 --- a/classes/database/Postgres.php +++ b/classes/database/Postgres.php @@ -3110,13 +3110,15 @@ class Postgres extends ADODB_base { * @param $tablespace The tablespaces ('' means none/default) * @return 0 success */ - function createIndex($name, $table, $columns, $type, $unique, $where, $tablespace) { + function createIndex($name, $table, $columns, $type, $unique, $where, $tablespace, $concurrently) { $this->fieldClean($name); $this->fieldClean($table); $sql = "CREATE"; if ($unique) $sql .= " UNIQUE"; - $sql .= " INDEX \"{$name}\" ON \"{$this->_schema}\".\"{$table}\" USING {$type} "; + $sql .= " INDEX"; + if ($concurrently) $sql .= " CONCURRENTLY"; + $sql .= " \"{$name}\" ON \"{$this->_schema}\".\"{$table}\" USING {$type} "; if (is_array($columns)) { $this->arrayClean($columns); @@ -7575,6 +7577,7 @@ class Postgres extends ADODB_base { function hasForeignKeysInfo() { return $this->hasConstraintsInfo(); } function hasMagicTypes() { return true; } function hasQueryKill() { return true; } + function hasConcurrentIndexBuild() { return true; } } ?> diff --git a/classes/database/Postgres81.php b/classes/database/Postgres81.php index 3701c68d..f8479a3f 100644 --- a/classes/database/Postgres81.php +++ b/classes/database/Postgres81.php @@ -235,6 +235,7 @@ class Postgres81 extends Postgres82 { function hasCreateTableLikeWithConstraints() {return false;} function hasSharedComments() {return false;} + function hasConcurrentIndexBuild() {return false;} } ?> diff --git a/indexes.php b/indexes.php index f95b24db..08bc2f35 100644 --- a/indexes.php +++ b/indexes.php @@ -160,6 +160,13 @@ echo "\t\t\t\n\t\t\n\t\n"; } + if ($data->hasConcurrentIndexBuild()) { + echo ""; + echo ""; + echo ""; + echo ""; + } + echo ""; echo "

\n"; diff --git a/lang/english.php b/lang/english.php index db9a0d66..a0758597 100644 --- a/lang/english.php +++ b/lang/english.php @@ -460,6 +460,7 @@ $lang['strconfcluster'] = 'Are you sure you want to cluster "%s"?'; $lang['strclusteredgood'] = 'Cluster complete.'; $lang['strclusteredbad'] = 'Cluster failed.'; + $lang['strconcurrently'] = 'Concurrently'; // Rules $lang['strrules'] = 'Rules'; diff --git a/lang/recoded/english.php b/lang/recoded/english.php index 7357470a..f864eb17 100644 --- a/lang/recoded/english.php +++ b/lang/recoded/english.php @@ -460,6 +460,7 @@ $lang['strconfcluster'] = 'Are you sure you want to cluster "%s"?'; $lang['strclusteredgood'] = 'Cluster complete.'; $lang['strclusteredbad'] = 'Cluster failed.'; + $lang['strconcurrently'] = 'Concurrently'; // Rules $lang['strrules'] = 'Rules';