X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=db%2Fstatusnet_pg.sql;h=27b189e288d24485018b391b52dfd954f35534d6;hb=b189c9500c3ea5362edfcbf818c2f847b4892da5;hp=672877ddf0bac25ba3bdfdbcb0c18e8a14460470;hpb=81aada21447b7561e759886b327aa7798a490bb2;p=quix0rs-gnu-social.git diff --git a/db/statusnet_pg.sql b/db/statusnet_pg.sql index 672877ddf0..27b189e288 100644 --- a/db/statusnet_pg.sql +++ b/db/statusnet_pg.sql @@ -115,8 +115,8 @@ create table subscription ( primary key (subscriber, subscribed) ); -create index subscription_subscriber_idx on subscription using btree(subscriber); -create index subscription_subscribed_idx on subscription using btree(subscribed); +create index subscription_subscriber_idx on subscription using btree(subscriber,created); +create index subscription_subscribed_idx on subscription using btree(subscribed,created); create sequence notice_seq; create table notice ( @@ -137,7 +137,7 @@ create table notice ( /* FULLTEXT(content) */ ); -create index notice_profile_id_idx on notice using btree(profile_id); +create index notice_profile_id_idx on notice using btree(profile_id,created,id); create index notice_created_idx on notice using btree(created); create table notice_source ( @@ -171,7 +171,7 @@ create table fave ( ); create index fave_notice_id_idx on fave using btree(notice_id); -create index fave_user_id_idx on fave using btree(user_id); +create index fave_user_id_idx on fave using btree(user_id,modified); create index fave_modified_idx on fave using btree(modified); /* tables for OAuth */ @@ -560,12 +560,12 @@ create table config ( ); -create table user_role ( +create table profile_role ( - user_id integer not null /* comment 'user having the role'*/ references "user" (id), + profile_id integer not null /* comment 'account having the role'*/ references profile (id), role varchar(32) not null /* comment 'string representing the role'*/, created timestamp /* not null comment 'date the role was granted'*/, - primary key (user_id, role) + primary key (profile_id, role) -); +); \ No newline at end of file