View Full Version : How to rebuild stats?
October 13th, 2008, 10:11 AM
We had a user post a classified with a price of $10,000,000,000 and then marked it sold. It, obviously, trashed any meaningful information that was showing in the stats table for the number of items sold and the value of items sold. We've since deleted the ad so that it is no longer in the system but the stats cache has not been updated to reflect this. Is there a mysql query I can run to force a rebuild of the status table?
October 13th, 2008, 05:49 PM
No there is no query for this but you could run some query to reduce the stats table by 1 product and 10,000,000,000 like so
UPDATE cp_stats SET amt_sold=(amt_sold-10,000,000,000), ads_sold=(ads_sold-1) WHERE id=1;
October 13th, 2008, 05:59 PM
Thanks for the follow up Chuck. Given the cp_products table is there a way to determine what has been marked as sold and retrieve the price so I can recalculate the total sold that way? That way I can calculate it accurately and get back to a realistic number.
We have 400+ sales through our marketplace but when this guy added his item for $10,000,000,000 it reset the total value to that same number so I end up with $0.00 if I subtract out that number.
I'm comfortable with a mysql update statement to reset the number of sales and amount sold I'd just like to know how to determine what has been sold in the cp_products table.
Thanks for any additional guidance you can offer!
October 13th, 2008, 06:15 PM
No sorry no way to do that as products get deleted over 2 weeks old that are expired.
October 19th, 2008, 10:55 AM
Bummer...thanks for the update though
October 19th, 2008, 11:32 AM
Not a problem glad to answer for you even if its a bummer
January 29th, 2009, 10:46 PM
I now have the same problem. Would be nice if we could regenerate that stat.
January 30th, 2009, 08:47 AM
There is no way to regenerate stats since ads are deleted after being expired. One of the processed when expiring auctions selling ads is to update the stats. Now after an ad is gone it is deleted by the system hense there is nothing to rebuilt stats from.
February 3rd, 2009, 04:53 AM
Ok, I found the offending classified and deleted it. Now how do I go and correct the total sold amount by the amount of that one classified?
February 3rd, 2009, 08:17 AM
I tried editing the amt_sold entry in the pp_stats table to what it should be, but it never gets reflected on my classifieds page.??
February 3rd, 2009, 10:03 AM
If you edited the stats table to another amount it will be reflected on your index page. Remember if you are using the category cache it might take a little to reflect that change.
February 3rd, 2009, 10:50 AM
Got er done, thanks.
February 3rd, 2009, 11:45 AM
Have a good day.
vBulletin® v3.8.1, Copyright ©2000-2014, Jelsoft Enterprises Ltd.