A poor performance on FileGeoDatabase Api

448
0
06-10-2018 06:58 PM
Leelin
by
New Contributor II

Hi, I tried to getting the count of some filegeodatabase rows with "File Geodatabase API 1.4", but the performance is very poor as following statements:

The Source code

Geodatabase geodatabase = Geodatabase.Open(@"xxxxxx");

var countStatements = $"SELECT count(*) FROM blk WHERE OBJECTID=1 or OBJECTID=2";
var countRows = geodatabase.ExecuteSQL(countStatements);

var countEnumerator = countRows.GetEnumerator();

if(countRows != null)
{
       countEnumerator.MoveNext();
       count = (int)countEnumerator.Current.GetDouble(0);
}

It took about two seconds to getting the result. The performance is very poor!

How can I promote the performance through query sql statements or the other approach?

I’m very appreciate for your any help.

 

I have posted it to the File GeoDatabase API discuss : How to promote the performance on querying filegeodatabase entries count?? 

 

Thanks,

Casper. Lee

0 Kudos
0 Replies