Select to view content in your preferred language

How to increase performance (first start/open) for querying MapCache

1314
2
01-09-2012 11:49 PM
ThomasDobrzinski1
Emerging Contributor
Hi ,

I tried to query a MapCache (version 10, size: ~600 mb) with a simple query. This worked , but it took a long time for the first use, about 5 minutes.
Afterwards the query took 2 seconds. It seems that the MapCache will be initialized or indexed (?)  or something like this.

This is my Code:
//Creates a where clause string.
     string[] col = new string[9];
     col[0] = "column1";
     col[1] = "column2";
     col[2] = "column3";
     col[3] = "column4";
     col[4] = "column5";
     col[5] = "column6";
     col[6] = "column7";
     col[7] = "column8";
     col[8] = "column9";
     
     StringBuilder whereClause = new StringBuilder();
     
      whereClause.Append(MyLayer.Columns["columns1"] + " = '" + txtBox.Text.ToString() + "'");


     // Creates a instance of a query filter.
     QueryFilter queryFilter = new QueryFilter();
     queryFilter.WhereClause = whereClause.ToString();

FeatureDataTable fdt = MyLayer.getDataTable(queryFilter);
...


I also tried to use the GetDataReader, but the duration for the first start was also very long.

Do you have any ideas how to increase the performance or why the query takes so long for the first start?

best regards,
Thomas
0 Kudos
2 Replies
JeremyBanner
Deactivated User
I have the exact same problem.  Have you made any progress on this?
0 Kudos
StephenDickinson
Esri Contributor
I can confirm that I've experienced the same behaviour.  First query on any cache data takes a long time to execute and then subsequent cache queries execute quickly.

I assume either data is loaded into memory and / or indexing is occurring as part of the first cache query execution.

I have noticed that this only persists for the lifetime of the application instance as the same pattern is apparent on application restart.
0 Kudos