我应该为表ShopsItems选择什么索引。
我有表Shops( shop_id - integer, primary key (B-Tree) )
和表Items( item_id - primary key (B - Tree))
。
现在我想创建表ShopsItems分组Shops with Items。我想这个表甚至不需要自己的主键。所以我想创建ShopsItems:
shop_id - integer, foreign key - but i also want to search by this( fast )
item_id - integer, foreign key - i don't want to search by this
我应该为shop_id选择哪种索引? 我知道我可能需要一些分组索引。