更新Prestashop数据库

时间:2016-02-12 08:26:49

标签: php mysql optimization prestashop

我有关于Prestashop和数据库更新的性能问题。 我试图在Mysql innoDB上的Prestashop数据库集上更新库存。 问题是脚本大约需要3分钟来运行20000个实体的脚本。

我正在使用"参考"产品表中的字段,用于选择与该参考对应的ID。然后在Prestashop函数上使用ID:

$sql = 'SELECT id_product FROM '._DB_PREFIX_.'product WHERE reference = '. $reference

ID的选择查询如下:

// Matrix.h
class Matrix {
private:
    int matrix[3][3];
public:
    int* operator[](const int index) const;
};

// Matrix.cpp
int* Matrix::operator[](const int index) const {
    return this->matrix[index];
}

我已经将数据库中的引用设置为索引,它确实加快了一些但不是那么多。

对于更好的上下文,此脚本必须每15分钟运行一次以更新库存。

0 个答案:

没有答案