Over time, PrestaShop statistics tables accumulate millions of rows of connection logs, page view records, guest data, search queries, and 404 entries that slow down database queries without providing ongoing value. This module provides a safe, automated way to clean those tables on a schedule, keeping your database lean and your shop performing well.
- Cron endpoint with secure key authentication: A dedicated endpoint at
/module/tec_datacleaning/cron can be called by any scheduler. Requests must include the module's secure key, which is computed deterministically or set manually in the Back Office. - TRUNCATE and batched DELETE modes: A fast
truncate=1 option empties selected tables instantly. If TRUNCATE is blocked by database permissions or foreign-key constraints, the module falls back to batched DELETE with a configurable batch size. - Dry-run preview: Both truncate and clean operations support a
dry_run=1 parameter that reports row counts that would be removed without modifying any data. - Selective table management: The Back Office configuration lets you choose which statistic tables to include — covering
connections, connections_page, connections_source, guest, statssearch, and pagenotfound. The log table is always excluded from TRUNCATE operations to preserve log history. - Retention period control: Configure how many months of data to keep, so recent statistics are preserved while older records are removed.
This module is well-suited for store owners and developers who want to automate routine database maintenance without manual SQL intervention. The dry-run mode and batched DELETE fallback make it appropriate for production environments where data safety and permission constraints must be respected.
Comments (0)
Your review appreciation cannot be sent
Report comment
Report sent
Your report cannot be sent