AnsweredAssumed Answered

How to promote the performance on querying filegeodatabase entries count??

Question asked by casperlee on May 24, 2018
Latest reply on May 30, 2018 by casperlee

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.

 

Thanks,

Casper. Lee

Outcomes