Browse Source

Improve LP speed see BT#13335

jmontoyaa 7 years ago
parent
commit
1d9c0c4415
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/CoreBundle/Migrations/Schema/V2_0_0/Version20.php

+ 7 - 0
src/CoreBundle/Migrations/Schema/V2_0_0/Version20.php

@@ -461,6 +461,13 @@ class Version20 extends AbstractMigrationChamilo implements OrderedMigrationInte
                 'ALTER TABLE c_quiz ADD COLUMN notifications VARCHAR(255) NULL DEFAULT NULL;'
             );
         }
+
+        $table = $schema->getTable('c_lp_item_view');
+        if ($table->hasIndex('idx_c_lp_item_view_cid_id_view_count') == false) {
+            $queries->addQuery(
+                'CREATE INDEX idx_c_lp_item_view_cid_id_view_count ON c_lp_item_view (c_id, id, view_count)'
+            );
+        }
     }
 
     /**