database structure & speed

Ralf Sander ralf at end-if.de
Thu Dec 2 10:51:48 CST 2004


Hi Ruslan,
> On 12/2/04 2:29 AM, "Ralf Sander" <ralf at end-if.de> wrote:
>
> Hi Ralf,
>
>> I want to keep my database customizable through the user, and wonder
>> which is the best way to build it.
>> Some fields are predefined but the user can add additional ones.
>>
>> Using methods to create all fields and access fields through field
>> names is slower than using objects.
>
> You have test this ?

>> But if I use a cursor for adding
>> records or changing field values, I have to use field names (or index)
>> instead of objects, too. Will I run into the same speed issues here?
>
> You need write code which will work with any number of fields.
> And you cannot use access by name because you cannot know names of 
> future
> fields.

> You should use access by index.
> This is quite fast.
I thought, I could use a dictionary with all names, that I store in the 
database. This makes it easy to assign user-customizable content to 
each field on record creation. (eg. file creation date to field 
"userfield 12"
I can't imagine how access by index would work here?

>
>> Or is it best to create objects for my fixed fields and access the
>> userfields through methods?
>
> In REALBasic ?
Yes
>
> I wonder, you have test ?
> You have real problem of speed ?
> Or you just ASSUME ?
I have experienced a little bit with your example files. Its slower, 
but if this only influences creation/modification of records, I can 
live with it. There are other processes on creation of a record in my 
database, that makes the speed of valentina negligible here.
>

Thanks,
Ralf



More information about the Valentina mailing list