[VSDK] Tables

Ruslan Zasukhin ruslan_zasukhin at valentina-db.com
Sat Dec 3 16:09:17 CST 2011


On 12/2/11 4:45 PM, "Leo van Rijswijk" <leov at qmatix.com> wrote:

Hi Leo,

> Hi Ruslan
> 
> Another quick question...
> 
> With a request to I_Table_Ptr get_Table() the same object is returned.

yes

> Is it possible to get 2 different I_Table referring to the same table and
> pointing to different records?

No.

In SQL way Cursors do such logic. And two cursor in background talk to same
I_Table object. Although they do more smart job. Each cursor have own record
buffer.

 
> I assume I can use 2 dfferent I_Table referring to different tables in
> different threads at the same time, i.e. there is no conflict at
> I_Database_Ptr level?

Conflict can be in 4.x on cache level.
    We have single cache.
    We have single disk file ..

Right now, we develop internal support of threading,
and our first task we want resolve is Indexing of database.

We want that on N CPU we have build N indexes in the same time.
And we see that working on this, we will need provide mutexes for cache and
volume...

I hope only few weeks we need to get this. So lets hope this will start work
in 5.1 or 5.2.


> If I use BitSet and ArraySet I am still working with the same underlying
> I_Table, If I can only have one I_Table for the record access, and there is
> no record locking, is there a way to work with a range of records
> independently without blocking other threads, i.e.

> Do I need to copy the values to my own array to process?

> Can I lock the records and access with a different I_Table?

About LOCK of records in API way...

I have to think you can do next and be as effective as our locks in SQL way,
because we do the same actually.

You can Have table T with your N normal fields.
Then after open of db, you add one more TMP field of Boolean type and name
IsLocked.

Valentina is unique here -- that it can make TMP field !!
This field is stored on tmp volume. Not in the .dat file.
So if something happens your main data are not affected.

And no you can self do locks of records -- just set that field to be true.
And you can check it easy. Right ?


> I there a quick way to create a new temp table replicating the bitset record
> results, which I can then either update the original table or discard after
> processing.

My above trick solve problem?



-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list