You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by 马武 <22...@seu.edu.cn> on 2018/09/29 07:56:58 UTC

fieldsQueryCursor.getAll() performance is really bad



-----原始邮件-----
发件人:"马武" <22...@seu.edu.cn>
发送时间:2018-09-29 12:36:33 (星期六)
收件人: user@ignite.apache.org
抄送:
主题: fieldsQueryCursor.getAll() performance is really bad


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? my cache size is about
750000;

my code is like this :
queryStr  = "select id shopid,publictransit,fulladdress,phoneno,votetotal,
dishtags, comment, adpic,preferpicurl, 
dealgroupid,dealgrouptitle,dealgrouptype, newmembercardid,
newmembercardtitle, hasbooksetting,  isqueueable,banquetinfo,
gifurl,recommendlang from dpshop where id in (112166223) AND id > 0 "

FieldsQueryCursor<List&lt;?>> fieldsQueryCursor =
igniteRetrieve.getIgnite().cache("dpshopmaterial").query(new
SqlFieldsQuery(queryStr));
List<List&lt;?>> rowData = fieldsQueryCursor.getAll();  // very slow !!!


my record object as follows:
@SchemaDefinition(name = "dpshopmaterial")
public class DpShop {
    @QuerySqlField(index = true)
    @FieldMapping(name = "entityid")
    private String id;

    @QuerySqlField
    @FieldMapping
    private Integer entitytype;
    .................

it has the index field and sql is still very slow and 
the  fieldsQueryCursor.getAll()  consuming 99% of the time . Is there any
way to tune 
cursor.getAll()  or any alternate way to get data from cursor. ]


best regrds

mawu



Re: fieldsQueryCursor.getAll() performance is really bad

Posted by "Maxim.Pudov" <pu...@gmail.com>.
As long as you use IN statement there is no need in additional id > 0
condition. It might lead to retrieving all data that fit for id > 0 and
filtering them on the client side.
Use could use "explain" to check whether my guess was right
https://apacheignite-sql.readme.io/docs/performance-and-debugging#section-using-explain-statement. 



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/