Do sqlite databases use anything like a flyweight pattern for TEXT values. If I’m repeatedly using only a few different, short TEXT values in a column, would it be better to replace them with integers?
Do sqlite databases use anything like a flyweight pattern for TEXT values. If I’m
Share
SQLite stores each copy of the text column individually:
So if you want to avoid duplicating your strings you should use integers, set up a separate table to map your integers to strings, and then add a foreign key to this new table so that you can ensure referential integrity.