Big difference between REST and Geoprocessor query performance

Discussion created by mtdave on Jun 17, 2014
Latest reply on Jun 19, 2014 by
I've written an application for bench marking and tracking performance of ArcGIS Server. As part of the app it does a Javascript API Query Task of a feature layer though the REST and later runs the Select By Attribute GP tool from a Geoprocessing Task. This is the same SDE feature class with about 1.34 million polygons, it has both spatial and attribute indexes in place. The query runs in about 1 second from the REST but takes 1 1/2 minutes from the GP Tool. What is up with that?

The SDE feature class is in PostgreSQL SDE 10.2.2
ArcGIS Server 10.2.2
Windows 2008 r2

The definition query and rendering performance is great! GP is really slow!