Magento-产品属性-建议的最大值? [英] Magento - product attributes - recommended maximum?

查看:60
本文介绍了Magento-产品属性-建议的最大值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望为Magento安装添加大量(约200个)产品属性.其中大多数将是二进制的.

I'm looking to add a significant number (about 200) product attributes to a Magento installation. Most of them will be binary.

我看到每个属性都会在商品展示表中添加一列.我是否应该期望由于添加了这些属性而对性能产生影响?属性数量的最佳做法是什么?

I see that each attribute adds a column to the flat product table. Should I expect to see a performance hit because of the addition of these attributes? What's the best practice for number of attributes?

我们正在使用Magento 1.6.1

We're using Magento 1.6.1

推荐答案

我认为您唯一需要注意的是最大Mysql行大小.请参阅文章以获取解释.这是摘录中的一部分,以了解我在说什么:

I think the only thing you should be aware of is max Mysql row size. See this article for explanation. Here's one excerpt from it to understand What I'm talking about:

每个表(与存储引擎无关)的最大行大小为65,535字节.存储引擎可能会对此限制施加其他限制,从而减小有效的最大行大小.

Every table (regardless of storage engine) has a maximum row size of 65,535 bytes. Storage engines may place additional constraints on this limit, reducing the effective maximum row size.

最大行大小限制了列数(可能还有大小),因为所有列的总长度不能超过该大小.例如,utf8字符每个字符最多需要三个字节,因此对于CHAR(255)CHARACTER SET utf8列,服务器必须为每个值分配255×3 = 765字节.因此,一个表不能包含超过65,535/765 = 85个这样的列.

The maximum row size constrains the number (and possibly size) of columns because the total length of all columns cannot exceed this size. For example, utf8 characters require up to three bytes per character, so for a CHAR(255) CHARACTER SET utf8 column, the server must allocate 255 × 3 = 765 bytes per value. Consequently, a table cannot contain more than 65,535 / 765 = 85 such columns.

因此,如果200个属性的总大小超过此值(65,535字节),您将无法将所有属性存储在平面表中.在这种情况下,您应该缩短拥有的属性的数量,或者只是不要将所有属性放置到平面表中.您仅需要在产品列表"页面上可用的属性.我不认为您要在那里显示所有200个...

So if the total size of your 200 attribute exceeds this value (65,535 bytes), you just won't be able to store all your attributes in Flat table. In that case you should shorten the amount of attributes you have, or simply do not place ALL your attributes to Flat table. You need there only attributes that should be available on Product Listing pages. I don't thing that you're going to show all 200 there...

这篇关于Magento-产品属性-建议的最大值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆