Hi Kevin, Could you please provide the source code of SelectedClass and estimate number of entries in the cache? As Vladislav mentioned, most probably this is a matter of setting indexes on relevant fields. If you provide the source code, we will be able to give you exact example on how to do that.
Vladimir. On Mon, Jun 6, 2016 at 5:56 AM, Zhengqingzheng <zhengqingzh...@huawei.com> wrote: > Hi there, > > When using sql query to get a list of objects, I find that the performance > is really slow. I am wondering, is this normal? > > I tried to call a sql query as follows: > > String qryStr = "select * from SelectedClass where field1= ? and > field2=?"; > > SqlQuery<BinaryObject, BinaryObject> qry = new > SqlQuery(SelectedCalss.class, qryStr); > > qry.setArgs( "97901336", "a88"); > > > > If I call getAll() method like this: > > List<Entry<BinaryObject, BinaryObject>> result = > cache.withKeepBinary().query(qry).getAll(); > > It took 160ms to get all the objects (only two objects inside the list) > > > > it takes 1ms to get a querycursor object, like this: > > QueryCursor qc = cache.withKeepBinary().query(qry); > > But still need 160ms to put the objects into a list and return; > > > > Best regards, > > Kevin > > > > > > >