gpt4 book ai didi

mysql - 可以在同一个数据库上混合存储引擎吗?

转载 作者:行者123 更新时间:2023-11-29 00:02:37 28 4
gpt4 key购买 nike

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

在 VPS 上,所有表都是 MyISAM,在 mysql 5.1.x.x 上使用 latin1_swedish_ci 归类。在新服务器上,我切换到 TokuDBMariaDB 10 。对于某些表,我不得不删除 FULLTEXT 索引,我发现性能有所下降(所有表现在都在 TokuDB 上)。

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

非常感谢!

最佳答案

我认为这是正确的,我在一个数据库中混合了存储引擎,而且数据库的速度是正确的。

无论如何,如果您将 opencart 与很多产品(50,000)一起使用,我建议您为(所有)表创建索引,如果您这样做可以提高速度。

我做了以下事情:

    #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);

您必须在表格上加上“前缀”。

是这样的: http://www.codigojavaoracle.com/desarrollo-web/mejorar-la-velocidad-en-opencart/

关于mysql - 可以在同一个数据库上混合存储引擎吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29051526/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com