Long transaction commits.

May 21, 2013 at 10:29 PM
Hi Blaze!

I've noticed two things.
In one transaction i was writing:
  • 8364 x byte[36] structures.
  • 1081 x byte[44] structures.
  • 1122 x byte[8] (date entries).
  • Approximately 8364 nested tables.
All nested tables had Technical_SetTable_OverwriteIsNotAllowed() set.
When I transaction.commit ()-ed
Transaction commit took 958346ms (958 seconds).

When I was observing what was going on was mostly writing small chunks to the .rol file.
610716 bytes - 10000018.rol as You can see rol file is not that big, but it was writing to it
very slowly.

2.

When I attempted this the first time I stopped it at like 200 seconds of work. Restarted the
program. It was taking a lot of time to boot dbreeze. Probably working on .rol file.

I wonder why so many small .rol writes. And such a long time to process rol files.
Coordinator
May 22, 2013 at 6:55 AM
Publish your code.
Coordinator
May 22, 2013 at 7:00 AM
But I think I know where the problem is.
When we have more then 50-100 tables in one transaction, probably Technical_SetTable_OverwriteIsNotAllowed must be also applied to Transaction Journal.
It's not implemented yet.
Restoration from rollback also seems to be natural for such quantity of tables.
May 22, 2013 at 7:03 AM
Yeah. I am thinking of reducing the number of tables by using compound keys rather.
May 22, 2013 at 7:13 AM
I will need some help with that, I'll contact You later. I bet You know some better ways how to achive what I need.
Coordinator
May 22, 2013 at 7:15 AM
In any case publish your code, may be it's gonna be possible to optimize smth.
May 22, 2013 at 7:26 AM
It's kinda difficult because the code is sparse. I'll try, or I'll try to describe it as best as I can.
Coordinator
May 25, 2013 at 1:23 PM
Edited May 25, 2013 at 1:24 PM
Release 049 solves nested tables commit speed.

This code creates 8000 nested tables, writes 1 kvp to each of them and executes 5 seconds.
 private void testC11()
        {
            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            sw.Start();

            using (var tran = engine.GetTransaction())
            {
                tran.Technical_SetTable_OverwriteIsNotAllowed("t1");
                NestedTable nt = null;
                for (int i = 1; i <= 8000; i++)
                {                
                    nt = tran.InsertTable<int>("t1", i, 0);
                    //nt.Technical_SetTable_OverwriteIsNotAllowed();
                    nt.Insert<int, int>(1, 1);                  
                }

                 tran.Commit();
            }
            sw.Stop();
            Console.WriteLine("Consumed: {0}", sw.ElapsedMilliseconds);
}
May 25, 2013 at 3:00 PM
That's nice blaze. However i got rid of so many tables. But nonetheless this is a great feature.