> >  select ....
> >  FROM instances as i
> >    inner join instance_fields as count using(instanceid)
> >    inner join instance_fields as first using (instanceid)
> >    inner join instance_fields as last using (instanceid)
> >    inner join instance_fields as severity using (instanceid)
> >    inner join instance_fields as summary using (instanceid)
> >    inner join instance_fields as node using (instanceid)
> >    inner join instance_fields as source using (instanceid)

I don't want to hijack this thread (not too much anyway) but this got me
thinking about JOINs since I have a database that uses a similar concept
(one table holds a number of key-value pairs for another).

As I understand it, an INNER JOIN is equivalent in pseudo-code to:

For (every record in table A)
   for (every record in table B)
      for (...)

where another for loop is added with each additional JOIN.

Using Christian's example, would SQLite use the pseudo-code represented
above or does it use some intelligence that all the JOINs are from the
same table and hence the pseudo-code is:

for (every record in table "instances")
   for (every record in table "instance_fields")

I suppose this is an interest in performance question than anything
else.

Thanks
Nick








********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

Reply via email to