Performance improvements when displaying local posts
[friendica.git/.git] / doc / database / db_post-origin.md
1 Table post-origin
2 ===========
3
4 Posts from local users
5
6 Fields
7 ------
8
9 | Field         | Description                                                  | Type               | Null | Key | Default             | Extra |
10 | ------------- | ------------------------------------------------------------ | ------------------ | ---- | --- | ------------------- | ----- |
11 | id            |                                                              | int unsigned       | NO   | PRI | NULL                |       |
12 | uri-id        | Id of the item-uri table entry that contains the item uri    | int unsigned       | NO   |     | NULL                |       |
13 | uid           | Owner id which owns this copy of the item                    | mediumint unsigned | NO   |     | NULL                |       |
14 | parent-uri-id | Id of the item-uri table that contains the parent uri        | int unsigned       | YES  |     | NULL                |       |
15 | thr-parent-id | Id of the item-uri table that contains the thread parent uri | int unsigned       | YES  |     | NULL                |       |
16 | created       | Creation timestamp.                                          | datetime           | NO   |     | 0001-01-01 00:00:00 |       |
17 | received      | datetime                                                     | datetime           | NO   |     | 0001-01-01 00:00:00 |       |
18 | gravity       |                                                              | tinyint unsigned   | NO   |     | 0                   |       |
19 | vid           | Id of the verb table entry that contains the activity verbs  | smallint unsigned  | YES  |     | NULL                |       |
20 | private       | 0=public, 1=private, 2=unlisted                              | tinyint unsigned   | NO   |     | 0                   |       |
21 | wall          | This item was posted to the wall of uid                      | boolean            | NO   |     | 0                   |       |
22
23 Indexes
24 ------------
25
26 | Name              | Fields              |
27 | ----------------- | ------------------- |
28 | PRIMARY           | id                  |
29 | uid_uri-id        | UNIQUE, uid, uri-id |
30 | uri-id            | uri-id              |
31 | parent-uri-id     | parent-uri-id       |
32 | thr-parent-id     | thr-parent-id       |
33 | vid               | vid                 |
34 | parent-uri-id_uid | parent-uri-id, uid  |
35 | uid_wall_received | uid, wall, received |
36
37 Foreign Keys
38 ------------
39
40 | Field | Target Table | Target Field |
41 |-------|--------------|--------------|
42 | uri-id | [item-uri](help/database/db_item-uri) | id |
43 | uid | [user](help/database/db_user) | uid |
44 | parent-uri-id | [item-uri](help/database/db_item-uri) | id |
45 | thr-parent-id | [item-uri](help/database/db_item-uri) | id |
46 | vid | [verb](help/database/db_verb) | id |
47
48 Return to [database documentation](help/database)