SQLite Forum

What would be the recommended way to hold an array of ~600 double values?
Login
> The application is high-end product used by top professional people in this particular industry.

So invest $2 per customer in a conservative 5% return account, taking the resulting $0.10 per year to pay for the storage each customer will use. Now you can store their data indefinitely, assuming you roll over server hardware once every 3 years.

> For this I considered the followings:

Why are you leaving out Keith's suggestion? 4. Store each preset vertically, rather than horizontally.

```
CREATE TABLE Customer(id, ...)

CREATE TABLE Presets(id, customer_id, description, ...)

CREATE TABLE PresetData(preset_id, order, value)

SELECT value FROM PresetData WHERE preset_id = ?1 ORDER BY order
```

Each value takes at least 2 bytes in ASCII form, one for a single-digit integer and a delimiter. (e.g. Comma, taking little-brother's JSON suggestion.) The ratio is therefore 4:1 for that easy case, not 8:1, coming down to 1:1 by the time you're at 5 decimal digits. 8-byte doubles can encode 15 digits to the right of the decimal point, so the doubles might actually be cheaper, if the preponderance of data with 6+ decimal digitsis high enough.