Create an account to edit articles | See Formatting Syntax for Wiki syntax | We look forward to your contribution!

Performance Tuning

Database Clean Up

This is a standalone version of the script that is included in ProductCart (Help > Database Clean Up Tool > Remove customer sessions). If your database is extremely large it may be more efficient to run this standalone script directly against the database with SQL Manager.

You may use this script to completely remove unused data from your database. This tool will reduce the size of your database and may improve performance. This action is permanent and cannot be reversed. We strongly recommend that you backup your database before you run this clean up script.

Declare @2Days AS DateTime 
Set @2Days = DATEADD(d, -2, GETUTCDATE())
DELETE FROM pcCustomerSessions WHERE pcCustSession_Date<@2Days

DELETE FROM configSessions 
WHERE configSessions.idconfigSession NOT IN 
(SELECT ProductsOrdered.idconfigSession FROM ProductsOrdered WHERE ProductsOrdered.idconfigSession<>0)

The following data will be removed when you run this tool:

  • Expired customer sessions (pcCustomerSessions table)
  • Expired BTO configuration sessions (configSessions table)