Aug 8, 2013 at 6:41 PM
Edited Aug 8, 2013 at 7:14 PM
Hi blaze, I'd like to get back to our discussion:
I already posted example of code in that discussion thread (just before Your last answer),
Now I've been doing some tests. As You can see in the example I got 2 nested tables in one
physical table. Table Guid and Data.
Now Data table is in a form of <ulong, byte>.
Guid table is in a form of <byte, ulong> where byte is actually guid converted to byte.
I am using the sequential guids (the one You suggested from one site):
So what I do is:
I receive List of guids which I use to query Guid table and get ulong value.
This ulong value is the key for Data table.
Now I remove guid key from Guid table,
then I remove key from Data table.
So now all is fine and well. But I've been doing some timing tests and if You look
at the method the part:
for (i = 0; i < sortedGuids.Count; ++i)
rawGuid = sortedGuids[i];
row = dt.Guid.Select<byte, ulong> (rawGuid, true);
id = row.Value;
Most time here is spent on the select itself actually. You have any suggestion for this maybe ?
I've been experimenting and replaced above code with the following code:
if (sortedGuids.Count > 0)
startGuid = sortedGuids;
stopGuid = sortedGuids[sortedGuids.Count - 1];
foreach (Row<byte, ulong> row2 in dt.Guid.SelectForwardFromTo<byte, ulong> (startGuid, true, stopGuid, true))
rawGuid = row2.Key;
if (dictionary.ContainsKey (rawGuid.ToBytesString ()))
id = row2.Value;
This can work much better, but sometimes it happens that some entries are not the ones
I wish to delete that's why You can see I check dictionary to see if I should or not delete them.
You can see that falseRecords variable counts those records.
Sometimes it's 0 sometimes it can as much as 1mil or 5mil or even more of the false ones.
I would really like to improve this so please give me some suggestions.