Root-Branch / cardamon

🌱 A tool for measuring the power consumption and carbon footprint of your software.
Other
13 stars 1 forks source link

Replace nanoid #44

Closed ohuu closed 2 weeks ago

ohuu commented 2 weeks ago

Nanoid produces human memorable strings but they are not easily indexed which could cause performance issues in large dbs. We could replace these with sequential integer ids or with uuid v7.

Leaning more towards sequential ids as I'm not sure if sqlite supports uuid properly so we hit the indexing problem again.

ohuu commented 2 weeks ago

Not sure this makes sense because the only thing that needs an ID now is the run_id in the ScenarioIteration and CpuMetrics table. This cannot be an auto-generated-by-the-db value, so we're down to using either nanoid or uuid v7 and uuid is not supported by sqlite (it's just a text entry) so there's really no advantage to using uuids