I am creating a db for my android app which requires different tables for different types of users. Basically, if user type A logs in he will use Table A, user type B logs in he will use Table B and similarly Table C.
Should I go ahead and create 3 tables and use only the table which the user type has logged in? Would this have any significant memory implications (size of the db)? That is, if the table doesn't contain data, would the sqlite db still allocate some space (other than for definitions of the columns).
The other way would be to check the user type and dynamically create the table at runtime once user logs in. I prefer the first method if there isn开发者_高级运维't much space used.
Any pointers or suggestions would be very useful.
The SQLite DB will occupy some space to store the table structures and the constraints/indexes. Why don't u just create the database tables (w/o any data) using SQLite Browser and check the size of the database file.
Would help you decide.
I think instead of creating all tables at one go use SQL queries to create tables as and when needed. If its not needed anymore you can even drop the table.
精彩评论