From 632d53699530de3695e988bda091ccdd098eeeb3 Mon Sep 17 00:00:00 2001 From: Simon Hobbs Date: Wed, 1 Dec 2021 00:07:20 +1100 Subject: [PATCH] Add index for depth. Add index for the subquery generated by the Top relationship. --- src/Storage/DbalNestedSetSchema.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Storage/DbalNestedSetSchema.php b/src/Storage/DbalNestedSetSchema.php index a30f07e5..467e68fe 100644 --- a/src/Storage/DbalNestedSetSchema.php +++ b/src/Storage/DbalNestedSetSchema.php @@ -27,6 +27,7 @@ public function create() { $tree->addIndex(['id', 'revision_id', 'left_pos', 'right_pos', 'depth']); $tree->addIndex(['left_pos', 'right_pos']); $tree->addIndex(['right_pos']); + $tree->addIndex(['depth']); foreach ($schema->toSql($this->connection->getDatabasePlatform()) as $sql) { $this->connection->exec($sql);