を使用してモバイルアプリケーションを構築しSqlite.Net
ていますが、Indexed
属性に出会いました。これは、次の例に示されています: https://github.com/praeclarum/sqlite-net#example-time
public class Stock
{
[PrimaryKey, AutoIncrement]
public int Id { get; set; }
[MaxLength(8)]
public string Symbol { get; set; }
}
public class Valuation
{
[PrimaryKey, AutoIncrement]
public int Id { get; set; }
[Indexed]
public int StockId { get; set; }
public DateTime Time { get; set; }
public decimal Price { get; set; }
}
ご覧のとおり、StockId
列は としてマークされていますがIndexed
、テーブルをクエリするSqlite
場合、インデックスを決定してクエリを最適化するのはエンジン次第です。
だから私の質問は、Indexed
属性が何に使用されているのか、それが必要なのですか?