Magento 2.1.3 – Huge url_rewrite Database Table Issue

backupdatabasemagento-2.1.3magento2

When trying to install an extension, or performing the average database backup, I've realized i have less then 200 products in my catalog, yet the backup takes FOREVER. In fact, there is a database table 800 megabytes large, while the biggest one after that is only 16 megabytes.

What can i do with this to lighten up my database?
Does this require a fresh new magento installation?

url_rewrite table

I will also mention that the same database once held 18000+ products.
In there, i currently see current look

Having nearly 30 links for the one flyer page makes absolutely no sense. Why is magento doing this and how can i fix it?

Is magento creating a store for every store view? because i should have 3 stores (demo 1, demo2 and demo3) with about 8 or 9 languages each… However even with 200 products, the database is still HUGE. There are over 2,200,400 records in the url_rewrite table!

Best Answer

I solved this TEMPORARILY with my own set of steps :

0 - Backup code, media, db.

1 - delete the magento stores wich are useless.

2 - delete the store views for each language wich are useless.

3 - check the database table url_rewrite, compare with current size of (mine)2200419 rows.

At this point, if the size does not decrease, this points to a problem with the SEO (search engine optimization) system. Use extreme caution when performing next steps :

4 - delete all products

5 - truncate url_rewrite and catalog_url_rewrite_product_category table

6 - save all product categories (Admin->Products->Categories)

7 - reimport products (system->import)

hope everything works properly and database is smaller.

Unfortunately I haven't found a code-based solution to permanently fix Magento

Related Topic