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);