k3s-io / kine

Run Kubernetes on MySQL, Postgres, sqlite, dqlite, not etcd.
Apache License 2.0
1.64k stars 238 forks source link

Superfluous index definition #113

Open mcekovic opened 2 years ago

mcekovic commented 2 years ago

Just scanning through repo and found superfluous index definition in most of the drivers:

CREATE INDEX IF NOT EXISTS kine_name_index ON kine (name), // Superfluous CREATE INDEX IF NOT EXISTS kine_name_id_index ON kine (name,id),

First index 'kine_name_index' is superfluous as RDBMSes can use second one 'kine_name_id_index' efficiently when searching just by 'name'. Removing this index can improve noticeably Kine insert performance and search by name performance would not be affected.

dereknola commented 2 years ago

@mcekovic we welcome community PRs!