diff options
author | Robin Appelman <robin@icewind.nl> | 2021-08-26 15:25:17 +0300 |
---|---|---|
committer | MichaIng <micha@dietpi.com> | 2021-11-27 04:48:43 +0300 |
commit | 88cc1ba064bb279e79386af469cc33705a65a688 (patch) | |
tree | 3a9e94b040e5eca8466e5067b27123b2703bc3b8 /core | |
parent | dcb99c43ed20e4e5d31333dbe79770607860688a (diff) |
disable path prefix index on postgresql for now
having the index work properly for the queries we need it for requires some additional options which dbal does not support at the momement.
to prevent making it harder to add the correct index later on we don't create the index for now on postgresql
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'core')
-rw-r--r-- | core/Application.php | 3 | ||||
-rw-r--r-- | core/Command/Db/AddMissingIndices.php | 3 | ||||
-rw-r--r-- | core/Migrations/Version13000Date20170718121200.php | 5 |
3 files changed, 8 insertions, 3 deletions
diff --git a/core/Application.php b/core/Application.php index 28f2a435981..489e36f0f94 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; @@ -115,7 +116,7 @@ class Application extends App { $subject->addHintForMissingSubject($table->getName(), 'fs_size'); } - if (!$table->hasIndex('fs_storage_path_prefix')) { + if (!$table->hasIndex('fs_storage_path_prefix') && !$schema->getDatabasePlatform() instanceof PostgreSQL94Platform) { $subject->addHintForMissingSubject($table->getName(), 'fs_storage_path_prefix'); } } diff --git a/core/Command/Db/AddMissingIndices.php b/core/Command/Db/AddMissingIndices.php index 4a079c945c7..819026a6211 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; @@ -144,7 +145,7 @@ class AddMissingIndices extends Command { $updated = true; $output->writeln('<info>Filecache table updated successfully.</info>'); } - if (!$table->hasIndex('fs_storage_path_prefix')) { + 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()); diff --git a/core/Migrations/Version13000Date20170718121200.php b/core/Migrations/Version13000Date20170718121200.php index b1a2eb6b2a6..7149f552eee 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; @@ -263,7 +264,9 @@ class Version13000Date20170718121200 extends SimpleMigrationStep { $table->addIndex(['storage', 'size', 'fileid'], 'fs_storage_size'); $table->addIndex(['mtime'], 'fs_mtime'); $table->addIndex(['size'], 'fs_size'); - $table->addIndex(['storage', 'path'], 'fs_storage_path_prefix', [], ['lengths' => [null, 64]]); + if (!$schema->getDatabasePlatform() instanceof PostgreSQL94Platform) { + $table->addIndex(['storage', 'path'], 'fs_storage_path_prefix', [], ['lengths' => [null, 64]]); + } } if (!$schema->hasTable('group_user')) { |