Skip to content

[Enhancement] tblActivityLog: add (shortCode, createdAt) composite index; decide partitioning #125

@Salem874

Description

@Salem874

Problem

The dominant analytics query is per-short-code over a date range, but tblActivityLog only has single-column indexes; monthly partitioning is a commented suggestion, not enabled (confirms earlier audit #12).

Fix

Add IDX_log_shortcode_created (shortCode, createdAt); review whether standalone IDX_log_shortcode/IDX_log_org remain justified given write cost. Decide on monthly partitioning before analytics ships.

Relates to analytics issues #41/#42.

Acceptance criteria

  • Composite index added; per-code date-range query uses it.
  • Partitioning decision documented.

From the 2026-06-04 schema review — see docs/SCHEMA_REVIEW_2026-06-04.md.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions