【发布时间】:2014-04-29 08:12:53
【问题描述】:
下午好,
我正在考虑最好将帖子保留在 sqlite 表 1 或多于 1,
举个例子,聊天,最好把它全部放在一张桌子上(如果可以的话)还是放在不同的桌子上更好?
(示例 1 表)
http://cmanios.wordpress.com/2013/10/29/read-sms-directly-from-sqlite-database-in-android/
- 我认为如果我们将所有信息都放在一个表中会更容易信息溢出(堆栈溢出)
android sqlite 表的限制:(相关主题)
Maximum SQLite Database Size in Android Application
SQLite database limits in Android
我的意思是我可以在一张表中包含更多消息。 从我的角度来看,作为一名程序员,我想创建多个表。
-
示例 1 和 x 表:
- ( 1 table ) (where user="select" ) 只需要查看特定的用户,例如“用户1和2的消息)
表:(用户 1 + 用户 2 + 用户 3 ... userx)
+-----------------------------------------------------------------------------------------------------------------+
| date | date_sent | person | body |
|------------------------------------------------------------------------------------------------------------------
| 2013-10-20 13:48:18 | 2013-10-20 13:48:16 | User1 | Hello Christos! How are you? |
| 2013-10-20 16:34:03 | 1970-01-01 02:00:00 | User2 | Fine, thanks ! I configure the left MFD of a F-16 jet |
| 2013-10-20 16:40:02 | 2013-10-20 16:40:01 | User3 | Awesome! I am throwing a party tomorrow at 21:45! |
| 2013-10-20 17:15:15 | 1970-01-01 02:00:00 | Userx | Thanks! I will be there! |
+-----------------------------------------------------------------------------------------------------------------+
- (2 个或更多表) 轻松选择所有表
+-----------------------------------------------------------------------------------------------------------------+
| date | date_sent | person | body |
|------------------------------------------------------------------------------------------------------------------
| 2013-10-20 13:48:18 | 2013-10-20 13:48:16 | User1 | Hello Christos! How are you? |
| 2013-10-20 16:34:03 | 1970-01-01 02:00:00 | User2 | Fine, thanks ! I configure the left MFD of a F-16 jet |
| 2013-10-20 16:40:02 | 2013-10-20 16:40:01 | User1 | Awesome! I am throwing a party tomorrow at 21:45! |
| 2013-10-20 17:15:15 | 1970-01-01 02:00:00 | User2 | Thanks! I will be there! |
+-----------------------------------------------------------------------------------------------------------------+
+-----------------------------------------------------------------------------------------------------------------+
| date | date_sent | person | body |
|------------------------------------------------------------------------------------------------------------------
| 2013-10-20 13:48:18 | 2013-10-20 13:48:16 | User1 | Hello Christos! How are you? |
| 2013-10-20 16:34:03 | 1970-01-01 02:00:00 | User3 | Fine, thanks ! I configure the left MFD of a F-16 jet |
| 2013-10-20 16:40:02 | 2013-10-20 16:40:01 | User1 | Awesome! I am throwing a party tomorrow at 21:45! |
| 2013-10-20 17:15:15 | 1970-01-01 02:00:00 | User3 | Thanks! I will be there! |
+-----------------------------------------------------------------------------------------------------------------+
。 . . .
我认为合适,创建多个表,我们不会有存储问题,都在一个表中。
谁能告诉我最好的方法是什么?或者如果我的概念有误
【问题讨论】:
标签: android mysql sql sqlite database-design