POST
|
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
... View more
06-10-2018
06:58 PM
|
0
|
0
|
238
|
POST
|
Hi, The problem is in the SQL query: it seems, there is no planer/optimiser in FileGDBApi. To execute the original SQL ( $"SELECT count(*) FROM TableName WHERE OBJECTID=1 or OBJECTID=2") takes 4466 ms on my table but to execute this one is only 16 ms on first run and 1 ms on second run: "SELECT Count(*) FROM Original WHERE OBJECTID IN (1, 2);" The full code: RowCollection rows = GDB.ExecuteSQL("SELECT Count(*) FROM Original WHERE OBJECTID IN (1, 2);"); foreach (Row row in rows) // Just to be generic. { int i = (int)row.GetDouble(0); } Ákos Halmai
... View more
10-23-2018
03:10 AM
|
0
|
0
|
116
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|