Benefits of declaring foreign key links.

Ed Kleban Ed at Kleban.com
Fri Dec 23 16:04:24 CST 2005




On 12/23/05 2:21 PM, "Ruslan Zasukhin" <sunshine at public.kherson.ua> wrote:

> On 12/23/05 6:25 PM, "Ed Kleban" <Ed at Kleban.com> wrote:
> 
>> If so then I would have phrased this differently and said the speed
>> improvement comes from having a direct reference from the child record to
>> the parent record instead of having to do an indexed jump.
>> 
>> Or have I misunderstood your point and gotten this wrong?
> 
> Wrong.
> 
> Issues comes from even SINGLE TABLE.
> 
> I believe this is described with pictures in Valentina Kernel.pdf
> Look on ObjectPtr description pages.
> 
> Main point is:
> 
> RDBMS have 
> 
>     * primary key field. It have PRIMARY index.
> 
>     * index of other field map
>             { f2_value, pk_value }
> 
>        - so you search index f2, then you need jump into pk index.
>         
>        - to optimize this, many RDBMS use hidden _rowid field,
>             so if you choose PK as string, you will not keep strings
>             in f2 index. But you still have 2 index jumps.
> 

Ah, I see now.   Well then.... That really sucks, doesn't it?  What a
pointless waste.

> Valentina instead have
>             { f2_value, recid }
> 
>             after search in f2 index you KNOW recid of record.  STOP
>             

Well, clearly then we should be using Valentina instead of a traditional
RDBMS.

Perhaps you start using the BBEdit marketing and T-shirt mantra:

    "Valentina  -- It doesn't suck!"






More information about the Valentina mailing list