ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rafael Troilo <rafael.tro...@uni-heidelberg.de>
Subject Index wont't be used with QueryEntity configuration
Date Wed, 14 Dec 2016 18:13:21 GMT
Hi,

I just try out the SpatialQueryExample and don't want to us annotations 
for the MapPoint class, but I have trouble to get the index to work.

Here is what I see:

CacheConfiguration<Integer, MapPoint> cc = new 
CacheConfiguration<>(CACHE_NAME);

SQL:  "explain analyze select _val from MapPoint where coords && ?"

With Annotiations:

cc.setIndexedTypes(Integer.class,MapPoint.class);

I got:

[[SELECT
     _VAL AS __C0
FROM "SpatialQueryExample".MAPPOINT
     /* "SpatialQueryExample"."coords_idx": COORDS && ?1 */
WHERE INTERSECTS(COORDS, ?1)], [SELECT
     __C0 AS _VAL
FROM PUBLIC.__T0
     /* "SpatialQueryExample"."merge_scan" */]]


With QueryEntity:

QueryEntity queryEntity = new QueryEntity(Integer.class.getName(), 
MapPoint.class.getName());
LinkedHashMap<String, String> fields = new LinkedHashMap<>();
fields.put("coords", Geometry.class.getName());
queryEntity.setFields(fields);
queryEntity.setIndexes(Arrays.asList(new QueryIndex("coords")));
cc.setQueryEntities(Arrays.asList(queryEntity));

I got:

[[SELECT
     _VAL AS __C0
FROM "SpatialQueryExample".MAPPOINT
     /* "SpatialQueryExample".MAPPOINT.__SCAN_ */
WHERE INTERSECTS(COORDS, ?1)], [SELECT
     __C0 AS _VAL
FROM PUBLIC.__T0
     /* "SpatialQueryExample"."merge_scan" */]]


The index won't be used in the QueryEntity configuration.

Do I do something wrong? Or do you have any suggestions?

Thank you!

Ciao,

Rafael

-- 
Rafael Troilo, Dipl.-Inform. (FH)
    GIScience Research Group
   
    Heidelberg Institute for Geoinformation Technology

    rafael.troilo@uni-heidelberg.de
    http://giscience.uni-hd.de
    http://www.geog.uni-heidelberg.de/gis/heigit.html
   
    Berliner Str. 45 (Mathematikon), D-69120 Heidelberg, Germany
    fon: +49(0)6221 / 54 / 19704


Mime
View raw message