schema: add some mysql indexes

This commit is contained in:
Andrew Dolgov 2010-11-20 00:47:22 +03:00
parent 2547c9ec18
commit ed7f0ecd37

View file

@ -82,6 +82,10 @@ create table ttrss_counters_cache (
foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE
); );
create index ttrss_counters_cache_feed_id_idx on ttrss_counters_cache(feed_id);
create index ttrss_counters_cache_owner_uid_idx on ttrss_counters_cache(owner_uid);
create index ttrss_counters_cache_value_idx on ttrss_counters_cache(value);
create table ttrss_cat_counters_cache ( create table ttrss_cat_counters_cache (
feed_id integer not null, feed_id integer not null,
owner_uid integer not null, owner_uid integer not null,
@ -90,6 +94,8 @@ create table ttrss_cat_counters_cache (
foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE
); );
create index ttrss_cat_counters_cache_owner_uid_idx on ttrss_cat_counters_cache(owner_uid);
create table ttrss_feeds (id integer not null auto_increment primary key, create table ttrss_feeds (id integer not null auto_increment primary key,
owner_uid integer not null, owner_uid integer not null,
title varchar(200) not null, title varchar(200) not null,
@ -143,6 +149,8 @@ create table ttrss_entries (id integer not null primary key auto_increment,
author varchar(250) not null default '') TYPE=InnoDB DEFAULT CHARSET=UTF8; author varchar(250) not null default '') TYPE=InnoDB DEFAULT CHARSET=UTF8;
create index ttrss_entries_date_entered_index on ttrss_entries(date_entered); create index ttrss_entries_date_entered_index on ttrss_entries(date_entered);
create index ttrss_entries_guid_index on ttrss_entries(guid);
create index ttrss_entries_updated_idx on ttrss_entries(updated);
create table ttrss_user_entries ( create table ttrss_user_entries (
int_id integer not null primary key auto_increment, int_id integer not null primary key auto_increment,
@ -167,6 +175,8 @@ create table ttrss_user_entries (
index (owner_uid), index (owner_uid),
foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) TYPE=InnoDB DEFAULT CHARSET=UTF8; foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) TYPE=InnoDB DEFAULT CHARSET=UTF8;
create index ttrss_user_entries_unread_idx on ttrss_user_entries(unread);
create table ttrss_entry_comments (id integer not null primary key, create table ttrss_entry_comments (id integer not null primary key,
ref_id integer not null, ref_id integer not null,
owner_uid integer not null, owner_uid integer not null,