|
From: Andrea A. <aa...@op...> - 2009-12-06 08:42:59
|
Ezequiel Coronel wrote: > this is an example of my code: > > the result query for example is this: > (ID_MAX_I = 10085551 OR ID_MAX_P = 10085551) AND AIP <= 1444 AND AFP >= 1444> > this query return a feature for do all my work..... The shapefile datastore in GeoTools only has one form of indexing, the spatial one. The above does not use any spatial filter, so the only way to resolve it is to fully load the whole shapefile and perform the filtering in memory. That is bound to be slow. I think you can improve a little thing by specifying in your query the attributes that you actually need to read, if they are not all you may get a little speedup (provided you are using 2.6.0, older releases read all attributes anyways). To get a very good speedup you'll have to move your data to a spatial database and index the column that are the most selective for your query. Or you can contribute code to perform indexing on the non spatial attributes as well if you want/can (warning, not trivial). Cheers Andrea |