summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Treat2009-07-06 01:07:38 +0000
committerRobert Treat2009-07-06 01:07:38 +0000
commita14fcf2a8d106779e6b62d91aea2b20001789c2c (patch)
treee519caceba267f5e60a0cda34ccd3d26e6ab07f4
parent6de576e9162e26bdbf58cd34438a4cdc3538000f (diff)
add support for concurrent index builds
-rw-r--r--HISTORY1
-rw-r--r--TODO1
-rwxr-xr-xclasses/database/Postgres.php7
-rw-r--r--classes/database/Postgres81.php1
-rw-r--r--indexes.php7
-rw-r--r--lang/english.php1
-rw-r--r--lang/recoded/english.php1
7 files changed, 16 insertions, 3 deletions
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</select>\n\t\t</td>\n\t</tr>\n";
}
+ if ($data->hasConcurrentIndexBuild()) {
+ echo "<tr>";
+ echo "<th class=\"data left\" scope=\"row\"><label for=\"formConcur\">{$lang['strconcurrently']}</label></th>";
+ echo "<td class=\"data1\"><input type=\"checkbox\" id=\"formConcur\" name=\"formConcur\"", (isset($_POST['formConcur']) ? 'checked="checked"' : ''), " /></td>";
+ echo "</tr>";
+ }
+
echo "</table>";
echo "<p><input type=\"hidden\" name=\"action\" value=\"save_create_index\" />\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 &quot;%s&quot;?';
$lang['strclusteredgood'] = 'Cluster complete.';
$lang['strclusteredbad'] = 'Cluster failed.';
+ $lang['strconcurrently'] = 'Concurrently';
// Rules
$lang['strrules'] = 'Rules';