Hi, Already Field4 having index([QuerySqlField(IsIndexed = true)]), which is used in where clause. Do you mean index for all fields if yes how that will solve this problem?
Thanks, Charlin On Wed, 31 May 2023 at 13:38, Zhenya Stanilovsky via user < user@ignite.apache.org> wrote: > Hi, seems you need to build index over this field. > > > > > > Hi All, > I am having two nodes cluster grid and cache model, which has 2126239 > records and Ignite query with IN operator taking too long sometimes 17 - 18 > seconds and another time around 40 seconds. > > Expected result : 30000 to 40000 records. > > ignite version: 2.10 > Ignite server hosted on linux box and C# .net 6 is the Ignite client > > Ignite cache model class > > public class TestModel : IBinarizable > { > > [QuerySqlField()] > public decimal? Field1 { get; set; } > > [QuerySqlField()] > public string Field2 { get; set; } > > [QuerySqlField()] > public string Field3 { get; set; } > > [QuerySqlField(IsIndexed = true)] > public string Field4 { get; set; } > > [QuerySqlField()] > public string Field5 { get; set; } > > public void ReadBinary(IBinaryReader reader) > { > if (reader != null) > { > Field1 = reader.ReadDecimal("field1"); > Field2 = reader.ReadString("field2"); > Field3 = reader.ReadString("field3"); > Field4 = reader.ReadString("field4"); > Field5 = reader.ReadString("field5"); > } > } > > public void WriteBinary(IBinaryWriter writer) > { > if (writer != null) > { > writer.WriteDecimal("field1",Field1) ; > writer.WriteString("field2",Field2) ; > writer.WriteString("field3",Field3) ; > writer.WriteString("field4",Field4) ; > writer.WriteString("field5",Field5) ; > } > } > > Ignite query execution code > string query = "select Field1,Field2,Field3,Field4 from TestModel where > Field4 in('1','2')"; > SqlFieldsQuery fieldsQuery = new SqlFieldsQuery(query); > ICache.Query(fieldsQuery); > > > Regards, > Charlin > > > > > >