简体   繁体   English

PS的SQL查询优化

[英]SQL Query optimisation for PS

I am currently creating my webshop for my local parts store using prestashop 1.7.8.6我目前正在使用 prestashop 1.7.8.6 为我的本地零件商店创建我的网上商店

I developed scripts on myself and have successfully made the website work correctly.我自己开发了脚本,并成功地使网站正常运行。

But, with 2 millions rows of products including each 30 columns and multiple joins, i can't have a decent loading time on getProducts query.但是,由于有 200 万行产品,包括每 30 列和多个连接,我无法在 getProducts 查询上获得合适的加载时间。

Even with indexes and cache...即使有索引和缓存...

I use a simple query on prestashop product table and join id products from car filter table to match ps_product table.我对 prestashop 产品表使用一个简单的查询,并从汽车过滤器表中加入 id 产品以匹配 ps_product 表。

I would like to know if it would be better to create tables for each vehicle using an id, and fill it with ps_product data, to use this table only instead of using multiple joins.我想知道是否最好使用 id 为每辆车创建表,并用 ps_product 数据填充它,以便仅使用此表而不是使用多个连接。

I'am using innoDB as engine.我正在使用 innoDB 作为引擎。

Thanks谢谢

Prestashop does not have great performance with such a huge amount of data/products, as you have seen using native methods, so the best option is to strengthen your MySQL server. Prestashop 在处理如此大量的数据/产品时没有出色的性能,正如您使用本机方法所看到的那样,因此最好的选择是加强您的 MySQL 服务器。

Consider using one or more dedicated machines for SQL with replication), by saving your data in external tables or store it to some distributed NoSQL system built to deal with large amount of data (like Elasticsearch or similar) so you can scale it easily and you can write your own code/module to retrieve what you need.考虑使用一台或多台用于 SQL 的专用机器进行复制),通过将数据保存在外部表中或将其存储到为处理大量数据而构建的分布式 NoSQL 系统(如 Elasticsearch 或类似系统),以便您可以轻松扩展它并且您可以编写自己的代码/模块来检索您需要的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM