[Geoserver-devel] feature count in WFS getFeature requests

Hi Developers,

I've noticed that GeoServer tries to get a feature count somewhere in the process of servicing getFeature requests. That is, it first gets a feature count (Datastore.getCount), then it actually queries and fetches the results. It can sometimes be a slow to get the count, and I have encountered a case with an ArcSDE query that takes about 20 seconds to perform the feature count.

Is it necessary for getFeature requests to obtain a feature count? I don't believe the count is even part of a getFeature response, is it? Can we remove the call to Datastre.getCount?

If the count is needed, can we probably just compute it as we fetch all the results, rather than calling Datastore.getCount, no?

Brock Anderson

ah, getCount could maybe being called for maxFeatures?
if so, it could be easy not to do it if not needed?

On Wednesday 10 August 2005 19:52, Brock Anderson wrote:

Hi Developers,

I've noticed that GeoServer tries to get a feature count somewhere in
the process of servicing getFeature requests. That is, it first gets a
feature count (Datastore.getCount), then it actually queries and fetches
the results. It can sometimes be a slow to get the count, and I have
encountered a case with an ArcSDE query that takes about 20 seconds to
perform the feature count.

Is it necessary for getFeature requests to obtain a feature count? I
don't believe the count is even part of a getFeature response, is it?
Can we remove the call to Datastre.getCount?

If the count is needed, can we probably just compute it as we fetch all
the results, rather than calling Datastore.getCount, no?

Brock Anderson

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Brock Anderson wrote:

Is it necessary for getFeature requests to obtain a feature count? I don't believe the count is even part of a getFeature response, is it? Can we remove the call to Datastre.getCount?

I think it is part of the FeatureCollection element and needs to be written out before we can start in on writing individual features.

If the count is needed, can we probably just compute it as we fetch all the results, rather than calling Datastore.getCount, no?

Sorry man no can do. It should be something that ArcSDE can provide an optimized implementation for though?
Jody

I got a stack trace, and your suggestion was correct Gabriel: for WFS getFeature requests getCount() is only being used to decrement "maxFeatures" in

    org.vfny.geoserver.wfs.responses.FeatureResponse.execute()

There may be an alternative way to correctly decrement maxFeatures, but I don't know what it is. Suggestions?

Brock

Gabriel Roldán wrote:

ah, getCount could maybe being called for maxFeatures?
if so, it could be easy not to do it if not needed?

On Wednesday 10 August 2005 19:52, Brock Anderson wrote:

Hi Developers,

I've noticed that GeoServer tries to get a feature count somewhere in
the process of servicing getFeature requests. That is, it first gets a
feature count (Datastore.getCount), then it actually queries and fetches
the results. It can sometimes be a slow to get the count, and I have
encountered a case with an ArcSDE query that takes about 20 seconds to
perform the feature count.

Is it necessary for getFeature requests to obtain a feature count? I
don't believe the count is even part of a getFeature response, is it?
Can we remove the call to Datastre.getCount?

If the count is needed, can we probably just compute it as we fetch all
the results, rather than calling Datastore.getCount, no?

Brock Anderson

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
   

yeah!
may be this can work: instead of calling getCount(), just wrap the returned
FeatureReader with a org.geotools.data.MaxFeatureReader, that should be all.

Gabriel.

On Thursday 11 August 2005 00:06, Brock Anderson wrote:

I got a stack trace, and your suggestion was correct Gabriel: for WFS
getFeature requests getCount() is only being used to decrement
"maxFeatures" in

    org.vfny.geoserver.wfs.responses.FeatureResponse.execute()

There may be an alternative way to correctly decrement maxFeatures, but
I don't know what it is. Suggestions?

Brock

Gabriel Roldán wrote:
>ah, getCount could maybe being called for maxFeatures?
>if so, it could be easy not to do it if not needed?
>
>On Wednesday 10 August 2005 19:52, Brock Anderson wrote:
>>Hi Developers,
>>
>>I've noticed that GeoServer tries to get a feature count somewhere in
>>the process of servicing getFeature requests. That is, it first gets a
>>feature count (Datastore.getCount), then it actually queries and fetches
>>the results. It can sometimes be a slow to get the count, and I have
>>encountered a case with an ArcSDE query that takes about 20 seconds to
>>perform the feature count.
>>
>>Is it necessary for getFeature requests to obtain a feature count? I
>>don't believe the count is even part of a getFeature response, is it?
>>Can we remove the call to Datastre.getCount?
>>
>>If the count is needed, can we probably just compute it as we fetch all
>>the results, rather than calling Datastore.getCount, no?
>>
>>Brock Anderson
>>
>>
>>-------------------------------------------------------
>>SF.Net email is Sponsored by the Better Software Conference & EXPO
>>September 19-22, 2005 * San Francisco, CA * Development Lifecycle
>> Practices Agile & Plan-Driven Development * Managing Projects & Teams *
>> Testing & QA Security * Process Improvement & Measurement *
>> http://www.sqe.com/bsce5sf
>> _______________________________________________
>>Geoserver-devel mailing list
>>Geoserver-devel@lists.sourceforge.net
>>https://lists.sourceforge.net/lists/listinfo/geoserver-devel