Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2021-10-19 17:41:23 +0300
committerGitHub <noreply@github.com>2021-10-19 17:41:23 +0300
commit5155f2b0c551703616ef8b7deb1a5b939b1c2450 (patch)
tree071610748e779a1c112a2036b7b19d12b3e666fe /core
parent1b16a136ebd8f63e09df061d383f34170e2cef35 (diff)
parent695326534c18749f36e9172e7b7345824213ee60 (diff)
Merge pull request #28541 from nextcloud/path-prefix-index2
add a prefix index to filecache.path, attempt 2
Diffstat (limited to 'core')
-rw-r--r--core/Application.php5
-rw-r--r--core/Command/Db/AddMissingIndices.php8
-rw-r--r--core/Migrations/Version13000Date20170718121200.php4
3 files changed, 17 insertions, 0 deletions
diff --git a/core/Application.php b/core/Application.php
index 43f32fcbdcc..d987f7cfb17 100644
--- a/core/Application.php
+++ b/core/Application.php
@@ -31,6 +31,7 @@
*/
namespace OC\Core;
+use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
use OC\Authentication\Events\RemoteWipeFinished;
use OC\Authentication\Events\RemoteWipeStarted;
use OC\Authentication\Listeners\RemoteWipeActivityListener;
@@ -118,6 +119,10 @@ class Application extends App {
if (!$table->hasIndex('fs_id_storage_size')) {
$subject->addHintForMissingSubject($table->getName(), 'fs_id_storage_size');
}
+
+ if (!$table->hasIndex('fs_storage_path_prefix') && !$schema->getDatabasePlatform() instanceof PostgreSQL94Platform) {
+ $subject->addHintForMissingSubject($table->getName(), 'fs_storage_path_prefix');
+ }
}
if ($schema->hasTable('twofactor_providers')) {
diff --git a/core/Command/Db/AddMissingIndices.php b/core/Command/Db/AddMissingIndices.php
index c4360157f72..348b4f94f0d 100644
--- a/core/Command/Db/AddMissingIndices.php
+++ b/core/Command/Db/AddMissingIndices.php
@@ -33,6 +33,7 @@ declare(strict_types=1);
*/
namespace OC\Core\Command\Db;
+use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
use OC\DB\Connection;
use OC\DB\SchemaWrapper;
use OCP\IDBConnection;
@@ -151,6 +152,13 @@ class AddMissingIndices extends Command {
$updated = true;
$output->writeln('<info>Filecache table updated successfully.</info>');
}
+ if (!$table->hasIndex('fs_storage_path_prefix') && !$schema->getDatabasePlatform() instanceof PostgreSQL94Platform) {
+ $output->writeln('<info>Adding additional path index to the filecache table, this can take some time...</info>');
+ $table->addIndex(['storage', 'path'], 'fs_storage_path_prefix', [], ['lengths' => [null, 64]]);
+ $this->connection->migrateToSchema($schema->getWrappedSchema());
+ $updated = true;
+ $output->writeln('<info>Filecache table updated successfully.</info>');
+ }
}
$output->writeln('<info>Check indices of the twofactor_providers table.</info>');
diff --git a/core/Migrations/Version13000Date20170718121200.php b/core/Migrations/Version13000Date20170718121200.php
index e8dbf1fc0fb..4fa8fb3d1e9 100644
--- a/core/Migrations/Version13000Date20170718121200.php
+++ b/core/Migrations/Version13000Date20170718121200.php
@@ -31,6 +31,7 @@
*/
namespace OC\Core\Migrations;
+use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\IDBConnection;
@@ -264,6 +265,9 @@ class Version13000Date20170718121200 extends SimpleMigrationStep {
$table->addIndex(['fileid', 'storage', 'size'], 'fs_id_storage_size');
$table->addIndex(['mtime'], 'fs_mtime');
$table->addIndex(['size'], 'fs_size');
+ if (!$schema->getDatabasePlatform() instanceof PostgreSQL94Platform) {
+ $table->addIndex(['storage', 'path'], 'fs_storage_path_prefix', [], ['lengths' => [null, 64]]);
+ }
}
if (!$schema->hasTable('group_user')) {