[1] Find attribute_id
in eav_attribute
table
75 - Description
76 - Short Description
[2] Go to catalog_product_entity_text
Table
entity_id
= Product Id
DELETE FROM catalog_product_entity_text WHERE attribute_id IN (75,76) AND entity_id IN (<Your Product Id's>)
OK, I have found a workaround. It is problematic only in the table, which has more than 2mil records.
We are searching for a categories, but inside this table there are a lot of rows regarding products. When I changed Magento Core file to add:
' AND url_rewrite.category_id is not null'
which helps database to pre-filter results. After that, the keys are used. If I can say that it is resolution or workaround, I don't know, but it is working.
Make a local copy of app/Core/Mage/Catalog/Helper/Category/Url/Rewrite.php and find:
public function joinTableToSelect(Varien_Db_Select $select, $storeId)
{
$select->joinLeft(
array('url_rewrite' => $this->_resource->getTableName('core/url_rewrite')),
'url_rewrite.category_id=main_table.entity_id AND url_rewrite.is_system=1 AND ' .
$this->_connection->quoteInto('url_rewrite.store_id = ? AND ', (int)$storeId) .
$this->_connection->prepareSqlCondition('url_rewrite.id_path', array('like' => 'category/%')),
array('request_path' => 'url_rewrite.request_path'));
return $this;
}
and change to this:
public function joinTableToSelect(Varien_Db_Select $select, $storeId)
{
$select->joinLeft(
array('url_rewrite' => $this->_resource->getTableName('core/url_rewrite')),
'url_rewrite.category_id=main_table.entity_id AND url_rewrite.is_system=1 AND ' .
$this->_connection->quoteInto('url_rewrite.store_id = ? AND ', (int)$storeId) .
$this->_connection->prepareSqlCondition('url_rewrite.category_id', array('notnull' => 1)) .
$this->_connection->prepareSqlCondition(' AND url_rewrite.id_path', array('like' => 'category/%')),
array('request_path' => 'url_rewrite.request_path'));
return $this;
}
This will add another filter to query.
Best Answer
I was also curious to find an updated database diagram. Actually I could not find one so I created one myself.
Magento CE 1.9.2.2 consists of 333 tables.
This is the database diagram of a fresh CE 1.9.2.2 installation:
As I cannot upload more than 2MB here, here's the link to the full size diagram