Re: why aren't my PRIMARY KEYs being used?

2004-11-01 Thread SGreen
I disagree with your LEFT JOIN/RIGHT JOIN results. SELECT activenodes.name,lrsrc.lid,activelayers.rsrcc,lrsrc.rsrc,nrsrc.rsrc FROM activelayers LEFT JOIN lrsrc ON lrsrc.id=activelayers.id AND lrsrc.lid=activelayers.lid RIGHT JOIN nrsrc ON lrsrc.rsrc=nrsrc.rsrc RIGHT JOIN activenodes ON

Re: why aren't my PRIMARY KEYs being used?

2004-10-30 Thread Laszlo Thoth
On Oct 29, 2004, at 6:26 AM, [EMAIL PROTECTED] wrote: I think it may be because of your mixed left and right joins. There are several bugs listed that show that the optimizer mishandles certain combinations of left and right joins. SELECT activelayers.id,activelayers.lid,activelayers.rsrcc,

Re: why aren't my PRIMARY KEYs being used?

2004-10-29 Thread SGreen
I think it may be because of your mixed left and right joins. There are several bugs listed that show that the optimizer mishandles certain combinations of left and right joins. May I suggest that you re-arrange your query to include only LEFT and INNER joins (at least until the bugs are worked

Re: why aren't my PRIMARY KEYs being used?

2004-10-29 Thread Gleb Paharenko
Hi. See: http://dev.mysql.com/doc/mysql/en/MySQL_indexes.html http://dev.mysql.com/doc/mysql/en/EXPLAIN.html It is ok that MySQL doesn't use indexes when selecting indexed columns that are compared using the = operator. You can read how indexes works. Laszlo Thoth <[EMAIL PROTECT

why aren't my PRIMARY KEYs being used?

2004-10-28 Thread Laszlo Thoth
I've created two temporary tables: CREATE TEMPORARY TABLE `activenodes` ( `id` smallint(6) unsigned NOT NULL default '0', `name` varchar(50) NOT NULL default '', `rsrcc` bigint(21) NOT NULL default '0', PRIMARY KEY (`id`) ); CREATE TEMPORARY TABLE `activelayers` ( `id` int(10) unsigned