Magento catalog URL rewrite indexing taking too long - magento

I've been dealing with this problem with around 10k+ products in two store views in magento 1.7.
The URL indexing process took around 30 hours to change its state to ready. Also i found multiple entries of the same product being made in the core_url_rewrite table and the number of rows now reached upto 6500k.
This is causing deadlocks. I tried clearing the locks but that didn't help. Is there a workaround solution for this problem as this is magento core functionality?

There's some good general advice on the Magento Stack Exchange site covering common indexing problems.
It's also common for larger store to create a rewrite/code-pool-override for the following method
#File: app/code/core/Mage/Catalog/Model/Resource/Url.php
protected function _getProducts($productIds, $storeId, $entityId, &$lastEntityId)
{
//...
}
This method queries for the products that need a URL reindex. By default, this includes all simple and configurable products. However, if you're not displaying simple products individually, you can tweak this query to not include those products. That can greatly reduce the number of URLs Magento needs to generate.

Related

Avoid query each time the page is loaded

I work on an educational website in which we show dynamic filters. What does this mean? We now have several course categories that will increase in number in the following weeks.
Right now categories are a string field in each course. I'm planning to model this and create a Categories table. Having done this, it would be pretty easy to load the filters based on the categories we have on the database. However, I see the problem that each time the website is loaded, the query will be made.
I thought of caching these categories but I'm guessing is not the best solution.
Any idea on how can I avoid these queries each time but get this information from the database?

Show simple product with all possible attribute combinations based on configurable product

I have an e-commerce site that provides made-to-order clothing. I've created a configurable product and just one associated product.
Is it possible to display all of the possible attribute combinations within just one associated product rather than manually add every combination?
I've tried allowing out of stock products to be displayed, but this didn't show all of the possible combinations.
I'm not hugely experienced with Magento, but I've used many CMS systems and inventory management products. I've never once seen a matrix / configurable / multi-variation / whatever you want to call it setup where you didn't have to create each combination as a distinct SKU. I'm not saying it's 100% impossible, but I'd view it as extremely unlikely and probably a waste of time to pursue.
Why not just create your configurable products and their sub SKUs via CSV import? It will be far easier and faster than creating them one at a time. Creating every combination will also be extremely easy. If you're not comfortable with Excel, you need to correct that yesterday if you want to be good at product management.
See this article:
https://www.siteground.com/tutorials/magento/import-products.htm

How to get product collection of given main category id?

In my website I have several stores available. One particular store contains both the simple and configurable products. This is a huge collection of products. What is the fastest way to get all enabled products (including child products of configurable products) collection of this store by store id?
Note: I tried this lot of different ways. But it takes loo much time. Sometimes cause to crash the server even.
Note : I'm using Magento CE 1.3
Any suggestions will be appreciated.
$collection = Mage::getModel('catalog/product')->getCollection();
$collection->addAttributeToSelect(array('name', 'url_key','price','lowest_price','service_id','description','short_description'));
$collection->addStoreFilter();
instead of use addAttributeToSelect('*') use only specific attributes which you needed because it effect performance of site
hope this will help you

Magento adding thousands of rewrites

We're having problems with our rewrites in Magento. Per day thousands of new product rewrites are being generated. At the moment we have 236940 product rewrites in our store and no solution yet.
It seems there is a loop in the rewrite process. The problem seems much like the one in this post: Magento - Removing numbers in url key/product url
The problems has something to do with having identical product url's.
This issue generates two problems:
1. the products will have a different URL daily in Google
2. the magento installation is filling with rewrites, which most certainly will cause trouble
What should we try to fix the product rewrite loop?
You will lose all of your stored rewrites by doing this, but you could truncate the core_url_rewrite table and re-index. That would give you a fresh start.

250000 Grouped products in Magento

I've started working on a new Magento webshop which has roughly 250000 different products. Each product can have different conditions (new, used, damaged, etc., each with their own price.). Magento doesn't seem to have a method to implement this at the moment. Of those 250000 products, there are about 150000 different conditions in stock and another 150000 conditions which aren't in stock but do have a price (which can be put on the wishlist).
Some numbers: 1500 categories, drop down attributes (country) with > 300 options, integer attributes (year). Starting with two websites 6 languages each.
I've thought out two solutions to solve this problem:
Grouped / Simple product structure
We create a grouped product which is the container product, each condition will be a different simple product. We'll relate these products to the grouped product.
The nice thing about this solution is that is pretty easy to implement, we'll have to import the data in the correct way and all the information is exactly presented in the way we want.
New Product type
We create a new product type which can have multiple conditions, each with their own inventory. On checkout the inventory is substracted. The problem with this is that implementing the CatalogInventory model in this way probably is difficult and building a whole product type is time consuming and bugprone in general.
The advantage of this solution is this that there will be about 2-2.5x times less products in the system.
Others
Are there any other options to solve this? Maybe there is a module that does all this?
In conclusion: Of course I prefer the first solution but can Magento handle that? Does anyone have experience with this much Grouped Products? The system will have about 550000 products (grouped + simple) products in the system, what will be the performance implications of this? What happens when the site grows and we'll have twice the amount of products?
Without knowing more details I'd lean towards using a new product type or just adding the feature independently of product types if you have a use for configurable products (I definitely wouldn't try to duplicate the configurable product type). I'd disable inventory management and use some additional tables which hold individual item inventory with the per-item conditions and maintain a separate inventory that way. Use events and overrides to control the CatalogInventory stock status as needed. Creating new products constantly which are largely duplicates seems like a hassle worth avoiding if this is a long-term endeavor that needs to scale.
However, the Grouped/Simple method might be a viable short-term solution and appropriate if the project is in it's early stages and can't afford a huge initial expenditure. If well-planned, a script should be able to convert all of the old grouped/simple products into your new product type when ready to launch.

Resources