Using the Managed Esent interface to read data from a table. I am doing this with (pseudo):
List<ColumnInfo> columns; //Three columns to be read
using (var table = Table(session,DBID,"tablename",OpenTableGrbit.Readonly))
{
while (Api.TryMoveNext(session, table))
{
foreach (ColumnInfo col in columns)
{
string data = GetFormattedColumnData(session,table,col);
}
}
}
I am interested in data from three columns only, which is around 4,000 rows. However, the table itself is 1,800,000 rows. Hence this approach is very slow to just read the data I want as I need to read all 1,800,000 rows. Is there a quicker way?
There are many things you can do. Here are a few things off the top of my head:
SystemParameters.CacheSizeMin. The default cache sizing algorithm is a bit conservative sometimes.OpenTableGrbit.Squentialwhen opening your table. This helps a little bit with prefetching.Api.RetrieveColumnsto retrieve the three values at once. This reduces the number of calls/pinvokes you'll do.-martin