1

我有一个 OpenCart 项目,数据库中有大约 50,000 种产品。我已经将网络托管从 VPS 切换到专用服务器,并且我看到了一些改进,但网站仍然滞后。

在 VPS 上,所有表都在 mysql 上进行MyISAM了排序。在我切换到的新服务器上和. 对于某些表,我不得不删除 FULLTEXT 索引,我发现性能有所下降(所有表现在都在 TokuDB 上)。latin1_swedish_ci5.1.x.xTokuDBMariaDB 10

将某些表切换回 MyISAM(仅使用 FULLTEXT 索引)是一个明智的决定吗?OpenCart 有一些查询加入了很多表……如果有些在 TokuDB 上,有些在 MyISAM 上,会有惩罚吗?我只是在寻找性能,资源排在第二位。

非常感谢!

4

2 回答 2

1

I think it is correct, I have mix storage engines in a databases, and the speed of database is right.

Anyway if you uses opencart with a lot products (50,000), I recomending you that you created index on (all) of your tables, if you do that you can improving your speed.

I did the following:

    #Tabla category campo parent_id
CREATE INDEX i_parent_id ON category (parent_id);

#Tabla category_description campo language_id
CREATE INDEX i_category_description ON category_description (language_id);

#Tabla category_path campos path_id y level
CREATE INDEX i_category_path ON category_path (path_id,level);

#Tabla category_to_store campo store_id
CREATE INDEX i_category_to_store ON category_to_store (store_id);

#Tabla manufacturer_to_store campo store_id
CREATE INDEX i_manufacturer_to_store ON manufacturer_to_store (store_id);

#Tabla product campos manufacturer_id, date_added, date_modified
CREATE INDEX i_product ON product (manufacturer_id, date_added, date_modified);

#Tabla product campos model, sku, upc, ean,(como veis donde tengais la referencia etc) y con tipo FULLTEXT (si el campo es de caracteres no de números)
CREATE FULLTEXT INDEX i_product_fulltext ON product (model, sku, upc, ean);

#Tabla product_description campo language_id
CREATE INDEX i_product_description ON product_description (language_id);

#Tabla product_to_category campo category_id
CREATE INDEX i_product_to_category ON product_to_category (category_id);

#Tabla product_to_store campo store_id
CREATE INDEX i_product_to_store ON product_to_store (store_id);

#Tabla setting campo store_id, serialized
CREATE INDEX i_setting ON setting (store_id, serialized);

#Tabla url_alias campo query con tipo FULLTEXT
CREATE FULLTEXT INDEX i_url_alias ON url_alias (query);# 6936 filas afectadas.

#Tabla zone campo country_id
CREATE INDEX i_zone ON zone (country_id);

#Tabla zone campo name y code con tipo FULLTEXT
CREATE FULLTEXT INDEX i_zone_fulltext ON zone (name,code);

You will have to put the 'prefix' on your tables.

Something like this: http://www.codigojavaoracle.com/desarrollo-web/mejorar-la-velocidad-en-opencart/

于 2015-03-14T19:27:26.533 回答
0

如果您知道自己在做什么以及为什么要这样做,那就可以了。

不同的引擎使用内存和磁盘存储的方式非常不同。对于 OLTP 类型系统,InnoDB 通常比 MyISAM 更明智(您在尝试不同的引擎之前检查过争用吗?)。但是,您添加到缓冲池(以提高 InnoDB 性能)的任何内存都不再可用于 VFS 或排序缓冲区(有助于提高 MyISAM 性能)。

我真的很难想象 TokuDB作为电子商务网站的存储基础有什么意义。一切都是为了获得更快的插入和更新写入,以及对 SSD 的低维护 - 选择性能很少比其他引擎好。

于 2015-03-14T21:32:29.323 回答