apache - Do I need an index for every field when using a BinaryObject? -


i've been doing experiments apache ignite. i've developing flexible object based on following code

public static void main(string[] args) throws igniteexception { ignite start = ignition.start("examples/config/example-ignite.xml"); cacheconfiguration<integer, binaryobject> cfg = new cacheconfiguration<>(); cfg.setqueryentities(new arraylist<queryentity>() {{     queryentity e = new queryentity();     e.setkeytype("java.lang.integer");     e.setvaluetype("binarytest");     e.setfields(new linkedhashmap<string, string>(){{         put("name", "java.lang.string");     }});     add(e); }}); ignitecache<integer, binaryobject> cache = start.getorcreatecache(cfg).withkeepbinary(); binaryobjectbuilder builder = start.binary().builder("binarytest"); builder.setfield("name", "test"); cache.put(1, builder.build());  querycursor<list<?>> query = cache.query(new sqlfieldsquery("select name binarytest")); system.out.println(query.getall()); 

however don't want have index on every field (i suspect expensive). realise without index may result in slower queries - i'm fine this.

using sample code above can not form sql query without first creating index field.

is possible use sql queries on binaryobjects without indexes? (note: ever store 1 'type' of binary object per cache).

thanks rich

indexes created when explicitely ask it. see [1] details on how configure them.

note sql schema static. if dynamically add field cache data type (this supported binary format [2]), field can't participate in sql query. achieve that, need recreate cache different configuration , reload data. however, there ticket [3] rid of limitation.

[1] https://apacheignite.readme.io/docs/sql-queries

[2] https://apacheignite.readme.io/docs/binary-marshaller

[3] https://issues.apache.org/jira/browse/ignite-735


Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -