Files
weewx/docs_src
Kevin Locke e153e13339 Remove unnecessary UNIQUE index on PK (#1034)
SQLite creates a unique index in addition to the clustered index for
`INTEGER NOT NULL UNIQUE PRIMARY KEY` columns.  The index is not
necessary to enforce uniqueness and is not used for existing queries.
Removing these unnecessary indexes reduced my database from 444MB to
395MB (11%).

Remove the `UNIQUE` constraint from `INTEGER PRIMARY KEY` columns to
avoid the unnecessary overhead.

Note: Testing with MariaDB 11.8.3 indicates that the `UNIQUE` constraint
is ignored (`SHOW CREATE TABLE` does not include `UNIQUE` and `SHOW
INDEX` only shows a `PRIMARY` index.)  Removing it will have no effect
that I am aware of for MariaDB.

Fixes: #1031

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2025-11-14 08:00:02 -08:00
..
2025-02-26 07:44:20 -08:00
2023-04-04 07:27:42 -07:00
2023-04-04 07:27:42 -07:00
2024-02-15 17:55:54 -08:00