Thursday 3 September 2015

How to disable Magento cache from database?

There is a easy process to disable the cache from database using sql update query
The Query is

UPDATE core-cache_options set value=0;

and you need to clear the cache folder at below path
rm -rf <YOUR SITE PATH HERE>/magento/var/cache/*


Delete the folder under rootfolder/magento/var/cache

In Magento Enterprise Edition you also have to clear the full_page_cache directory

rm -rf [YOUR SITE PATH HERE]/magento/var/full_page_cache/*

PHP Manual - .chm file is not working or not able to see content in php_manual_en.chm ?

The help file is being blocked from opening by windows, you should be able to unblock it by:

  1. Open Windows Explorer
  2. Find your CHM file
  3. Right click and select
  4. Properties Click the Unblock button on the General tab

What is EAV model in Magento?

EAV stands for Entity Attribute Value Model.
EAV also known as object attribute value model and open schema.
Entity (E): Entity actually refers to data item. For example we can consider it as customer, category or product.
Attribute (A): Attribute refers to the different attributes of the Entity. Like for example product have different attributes like color, size, price, etc.
Value (V): Value refers to the actual value of the attribute of the entity. Like color has value red, price has value $25, etc.
Below is the basic structure of the EAV (Considering product as an example):






Sample data are as below:


product_id (1)


attribute_id (1)                                                attribute_id (2)
product_id (1)                                                  product_id (1)
attribute_name (color)                                  attribute_name (price)


attribute_id (1)                                                     attribute_id (2)
product_id (1)                                                       product_id (1)
attribute_value (red)                                           attribute_value (290)
As per the above table structure, magento stores entry in three tables (actually more than three, but for this point it’s three). When you enter product in magento you have to insert different attributes of the product. So when you insert one product it will make one main entry in entity table. Then after with the reference of that entity id it will insert the various attributes (only name) of entity. At last with reference of entity id and attribute ids it will insert the actual value of the different attributes.
This is the basic structure of EAV which magento use. There may be (actually there are) some more complex structure of the EAV available but the main concept will remain same.

Why to use EAV?

EAV used because of scalability. We can insert anything without changing its structure. This is the main benefit of this structure.
Main problem with EAV structure is that, it is much slower than custom made solution because of SQL query complexity.
You need to make few join to retrieve just a single entity and in opposite in custom made solution we just have to make one simple select query to retrieve single entity.
Magento uses EAV structure because its designed to be scalable, regardless of speed problem.