opral / lix-sdk

1 stars 0 forks source link

without rowid #103

Open samuelstroschein opened 2 weeks ago

samuelstroschein commented 2 weeks ago

Context

We define primary keys, there is no need for the implicit rowid column that sqlite sets.

https://www.sqlite.org/withoutrowid.html

Proposal

Use withoutrowid.

samuelstroschein commented 2 weeks ago

Moving this ticket to release candidate because:

  1. The data structure is not impacted
  2. Neither are APIs impacted
  3. Without ROW ID can have negative impacts on larger rows and update hooks don't work anymore
  4. SQLite recommends to implement without rowid at the end of the development cycle

A good strategy is to simply not worry about WITHOUT ROWID until near the end of product development, then go back and run tests to see if adding WITHOUT ROWID to tables with non-integer PRIMARY KEYs helps or hurts performance, and retaining the WITHOUT ROWID only in those cases where it helps.

[Source](https://www.sqlite.org/withoutrowid.html#:\~:text=A%20good%20strategy%20is%20to%20simply%20not%20worry%20about%20WITHOUT%20ROWID%20until%20near%20the%20end%20of%20product%20development%2C%20then%20go%20back%20and%20run%20tests%20to%20see%20if%20adding%20WITHOUT%20ROWID%20to%20tables%20with%20non%2Dinteger%20PRIMARY%20KEYs%20helps%20or%20hurts%20performance%2C%20and%20retaining%20the%20WITHOUT%20ROWID%20only%20in%20those%20cases%20where%20it%20helps.)