Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [geomesa-users] Full table scan on attribute query when attribute is indexed

I believe we hit something like this before - the EQUALS predicate you're using is not what you think it is. Can you try using 'ff.equals' instead of 'ff.equal'? The later is org.opengis.filter.spatial.Equals, which only operates on geometries, the former is org.opengis.filter.PropertyIsEqualTo, which is what you want.

Thanks,

On 07/13/2017 05:29 AM, David Boyd wrote:

Emilio
All:

   Just got a strange issue.   I have a fairly large featuretype (>8M).
In my code I am looking to delete a given feature using this code:

        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
SimpleFeatureStore featureStore = (SimpleFeatureStore) store.getFeatureSource(LINKAGE_FEATURE_NAME); Filter filter =ff.equal(ff.property(LINKAGE_ENTITY1_KEY_COLUMN_NAME),ff.literal(entity.getKey()));

        featureStore.removeFeatures(filter);
My describe schema on the type gives:

[root@bdpgeoserver geomesa-accumulo_2.11-1.3.1]# bin/geomesa describe-schema -z bdpnode4 -i rdk -u root -c CoalesceSearch -f Linkages
Password (mask enabled)>
INFO  Describing attributes of feature 'Linkages'
objectKey      | String
entity1Key     | String  (Attribute indexed - join)
entity1Name    | String
entity1Source  | String
entity1Version | String
entity2Key     | String  (Attribute indexed - join)
entity2Name    | String
entity2Source  | String
entity2Version | String
lastModified   | Date    (Spatio-temporally indexed)
label          | String  (Attribute indexed - join)
linkType       | String  (Attribute indexed - join)
theWorld       | Polygon (Spatially indexed)

User data:
  geomesa.index.dtg            | lastModified
  geomesa.indices              | records:2:3,attr:4:3
  geomesa.table.sharing        | true
  geomesa.table.sharing.prefix |
But it get this log message for each delete:

2017-07-13 09:27:32,976 | WARN | [main] | (IdIndex.scala:77) - Running full table scan for schema Linkages with filter EQUALS(entity1Key, 'd01bb4ac-86ec-4035-86f2-1da765d1e3e9') 2017-07-13 09:27:32,977 | WARN | [main] | (IdIndex.scala:87) - Running full table scan for schema Linkages with filter EQUALS(entity1Key, 'd01bb4ac-86ec-4035-86f2-1da765d1e3e9')

Needless to say each one of these deletes is taking 20-30 seconds.

Thoughts?




Back to the top