0
我有唯一約束我還需要明確創建綜合指數,如果我有一個複合唯一約束
create table if not exists watchlist(
_id integer primary key autoincrement,
country text not null,
name text not null,
unique (country, name) on conflict replace
);
表由於我的查詢會在WHERE參與country
和name
條款的大部分時間。爲了加快查詢,我在想,我還需要創建
create index idx_country_name on watchlist(country, name);