Am Donnerstag, 9. November 2006 15:51 schrieb Becker, Holger:
> Michael Ruf wrote:
> > Hi,
> >
> > i've experienced a mysterious performance problem with MaxDB 7.5.00 26
> >
> > The following statement performs a full table scan when the
> > subquery returns
> > no result:
> >
> > delete from cx_click where link_id in ( select link_id from
> > cX_link where
> >  task_id = ? )
> >
> > Is this a bug?
> >
> >
> > regards
> > Michael
>
> Hi,
>
> for MaxDB link_id have to be the first or only column of the key or an
> index to avoid the full table scan in this case.
>

click_id is the primary key and there is an index on the link_id column. 
link_id is of type INTEGER.

The index is used while the subselects returns a result
delete from cx_click where link_id in ( 1234, 3454, 231 )

but not if the subselect return no result
delete from cx_click where link_id in ( )

I think that the optimizer should recognize that the in clause is empty and 
there will be no match. Or am i missunderstaning the semantic of an empty "in 
clause".

regards
Michael

----------------------------------------------------


--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to