Skip to content

[mariadb-query-optimization] - when not to add an index #23

Description

@federico-razzoli

I'm not sure it's good to have these points, here's why:

Low-cardinality columns

It depends. WHERE deleted = TRUE will use an index if the vast majority of rows has deleted=FALSE.

Small tables (< a few thousand rows): full scans are faster than index lookups for tiny tables.

Not true in the case of covering indexes. But the real problem is: Claude may run on the developer's laptop, where ALL tables are probably very small. Even in staging, all the tables might be very small. But in production they can be big.

Write-heavy columns

This might confuse LLMs. They don't seem to me very good at inferring which operations will run often.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions