No image available

Database Stats Cleaning

Automates cleaning of PrestaShop statistics tables (connections, page views, guest records, searches, 404s) via a cron endpoint with TRUNCATE and safe batched DELETE modes.

Developed by Tecnoacquisti.com

Get This Module Free on GitHub
License: MIT Status: Active Health: Very Outdated

Info updated 1 month ago

Sources
Last commit: Dec 18, 2025
Type
Module

Info checked: Mar 2, 2026

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.

  • Reference
    tec_datacleaning

  • License
    MIT
  • Status
    Active

Comments (0)

No customer reviews for the moment.
Loading...