ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pgarg <pg...@gridgain.com>
Subject How to improve query performance?
Date Fri, 08 May 2015 23:43:59 GMT
/asked by john smith/

Hi running RC3

I have the following cache config.... <bean
class="org.apache.ignite.marshaller.optimized.OptimizedMarshaller">
<property name="requireSerializable" value="false"/> </bean> ... <bean
parent="cache-template"> <property name="name" value="myCache"/> <property
name="cacheMode" value="PARTITIONED"/> <property name="atomicityMode"
value="ATOMIC"/> <property name="distributionMode"
value="PARTITIONED_ONLY"/> <property name="backups" value="0"/> </bean> ...
<bean id="cache-template" abstract="true"
class="org.apache.ignite.configuration.CacheConfiguration">

    <property name="startSize" value="1000000"/>
    <property name="queryIndexEnabled" value="true"/>
</bean>

My model look like so...

public class MyModel { @QuerySqlField(index = true) Long id;
@QuerySqlField(index = true) Integer someField1; @QuerySqlField(index =
true) Integer someField2; @QuerySqlField(index = true) String someField3;
@QuerySqlField(index = true) String someField14; @QuerySqlField(index =
true) String someField5; @QuerySqlField(index = true) String someField6;
@QuerySqlField(index = true) String someField7; @QuerySqlField(index = true)
String someField8; @QuerySqlField(index = true) Long someField9;
@QuerySqlField(index = true) String someField10; @QuerySqlField(index =
true) String someField11;

.. Setters and Getters here... }

And in my application I run...

// Do this once at startup... Ignite ignite = Ignition.start("cache.xml");
myCache= ignite.jcache("risk");

// Per http POST request in my servlet myCache.put(request.getId(),
request);

String sqlStr = "someField1 = ? OR "
+ "someField2 = ? OR "
+ "someField3 = ? OR "
+ "someField4 = ? OR "
+ "someField5= ? OR "
+ "someField6 = ? OR "
+ "someField7 = ? OR "
+ "someField8 = ? OR "
+ "someField9 = ?";

SqlQuery sql = new SqlQuery(MyModel.class, sqlStr);

QueryCursor<Entry&lt;Long, Transaction>> cursor =
myCache.query(sql.setArgs(...));

for (Entry<Long, Transaction> t : cursor) size++;

Even on a single node with verry few entries a couple thousand I am only
able to execute about 200 queries per second at average 400ms. Is there
anything I can do to improve the performance?

The query at most will only ever return 1-2 records even if the data grid
could reach millions of records.

----- 
/This post is migrated from now discontinued Apache Ignite forum at 
http://apacheignite.readme.io/v1.0/discuss/




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-to-improve-query-performance-tp79.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Mime
View raw message