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
|
240
|
POST
|
Hi Joshua, Thank you very much. Your suggestion help me to test File GeoDatabase reading/writing performance. I have opened another question to find other answers. Thanks, Casper. Lee
... View more
05-30-2018
07:57 PM
|
0
|
0
|
121
|
POST
|
Hi Joshua, Thanks for your further information. I have successful run your code. I think you want to find out the place where the performance is poor. The following items are the test result: 1. Geodatabase.Open(@"C:\test\testData.gdb"); It takes 12 milliseconds. 2. geodatabase.ExecuteSQL(countStatements); It takes 0 millisecond. 3. The first time: for (int i = 0; i < 1; i++) { countEnumerator.MoveNext(); count = (int)countEnumerator.Current.GetDouble(0); stop.Stop(); Console.WriteLine(stop.ElapsedMilliseconds / 1000); } It takes 2 seconds. 4. The second time: for (int i = 0; i < 1; i++) { countEnumerator.MoveNext(); count = (int)countEnumerator.Current.GetDouble(0); stop.Stop(); Console.WriteLine(stop.ElapsedMilliseconds / 1000); } It takes 2 seconds. Base on the test result, I guess the iteration of enumerator is the main reason. I haven't any idea to resolve it. Do you have the other suggestion? I'm very appreciate for your any help. Thanks, Casper. Lee
... View more
05-29-2018
07:16 PM
|
1
|
2
|
121
|
POST
|
Hi Joshua, Thanks for your suggestion. Unfortunately, the performance is still poor when I tried to run the querying more time base on a opened connection as following statements: Source code Geodatabase geodatabase = Geodatabase.Open(@"C:\test\testData.gdb"); var countStatements = $"SELECT count(OBJECTID) FROM blk WHERE OBJECTID=1 or OBJECTID=2"; var countRows = geodatabase.ExecuteSQL(countStatements); var count = 0; var countEnumerator = countRows.GetEnumerator(); var stop = Stopwatch.StartNew(); for (int i = 0; i < 2; i++) { countEnumerator.MoveNext(); count = (int)countEnumerator.Current.GetDouble(0); Console.WriteLine(stop.ElapsedMilliseconds / 1000); countEnumerator.Reset(); } stop.Stop(); The test result shown: 2 seconds and 4 seconds. It seems like without any changes. The test data information: File size: 330M Records count: 415000 Fields count: 37 Do you have the other suggestion? I'm very appreciate for your any help. Thanks, Casper. Lee
... View more
05-28-2018
07:17 PM
|
0
|
4
|
121
|
POST
|
Hi Joshua, Thanks for your replying, I'm trying to query some features from a ,gdb file, the .gdb file size is about 330M on local. I tried to run an SQL query on a .shp file (the size is about 430M), it takes about 980 milliseconds. On the .shp querying side, the querying tool is "OLEDB". I also confused on the querying behaviors: 1. Why does querying the count of features is very slow? 2. The performance is very poor when the iteration of queried features is moved to the last. My computer environment: OS: Win10 x64 Hardware: CPU: i7 4700, Memory: 16G, Hard disk: SSD 512G. I also tried to create a new FGDB and import the data into the new FGDB, but the performance is still poor. It still took about 2 seconds. Thanks, Casper. Lee
... View more
05-27-2018
11:15 PM
|
0
|
6
|
121
|
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. Thanks, Casper. Lee
... View more
05-24-2018
07:02 PM
|
0
|
9
|
448
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|