Open cahueya opened 7 months ago
I think it's a good idea, but I think before that I'd be interested to see why the reports pages is stalling.
That might be some missing indexes or something else inefficient, that needs to be replaced with better queries.
Database wise, we shouldn't have to think about purging data to make reports work well, they should be fine with tens/hundreds of thousands of records.
Thats a good input. So the example shop I'm talking has about 20000 Orders in place from around 900 products, producing around 800 reports pages in /store/reports/products and the page stalls half of time with HTTP500 when opening it. So you think reindexing would solve the issue?
So it's the actual list of products that is stalling? Or when you go a step further and view a particular product?
The list on first page load, so the first query without any options stalls already. But also when filtering by name, the stalls are happening.
If a shop runs over a period of time, the database grows with products and orders which can even lead to the reports pages to stalling sometimes.
Manual deletion of old products is a cumbersome clicki-clicki process and removing stuff from the database leaves a lot a of attribute values without their necessary counterparts.
What do you think about a function to remove products and orders by daterange or ID?
I mean - If a product is out of stock for 3 years so all the bookkeeping is done, it should be able to remove it safely together with all the connected data that piles up so much in the database. What do you think?