On Tue, Apr 13, 2010 at 05:58:41AM +0800, Colin Coe wrote:
> Tomas, apologies for the original reply.
> 
> My SQL skills are quite weak and doing the query wit joins did not
> occur to me.  Is using the joins more efficient?  I can't see a
> difference in the result returned when I run either of these queries.

Since there is a foreign key on rhnChannel(channel_arch_id) pointing
to rhnChannelArch(id), the queries will return exactly the same
results.

There is nothing wrong with your syntax or your query.

The only issue might be that when you or someone else will further
tweak the query to for example return rhnChannelArch.label as well,
with your query they might end up doing another inline select, instead
of using the rhnChannelArch from the FROM list. And since the foreign
key ensures that the cardinality of the result is not changed by
joining with the rhnChannelArch table, it's actually a tiny bit better
to do it the way Tomas has suggested.

-- 
Jan Pazdziora
Principal Software Engineer, Satellite Engineering, Red Hat

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to