Den 2013-01-18 13:31 skrev Svein Erling Tysvær såhär:
>
> > Hi,
> >
> > This SQL returns 2533 records, none of which contain B."Kod" starting
> > with 1711 or 2111 (checked thoroughly):
> > select B.*
> > from "Branschkod" B
> > inner join "Branschkod" B2 on B2."Namn" = B."Namn"
> > where B."ECO_ID" <> B2."ECO_ID"
> >
> > Now, I add a line to the WHERE:
> > select B.*
> > from "Branschkod" B
> > inner join "Branschkod" B2 on B2."Namn" = B."Namn"
> > where B."ECO_ID" <> B2."ECO_ID"
> > and B."Kod" in ('17111', '17112', '17113', '21111', '21112', '21113')
> >
> > This select DOES return six records, containing B."Kod" starting with
> > 1711 or 2111 (one for each code in the list).
> >
> > How can this happen?
>
> Maybe an index is damaged? See if the two queries use different plans 
> and recreate any index that is used in the first plan and not in the 
> second (I assume the six records exist, and that it is the 2533 
> records that should be at least 2539 records).
>

The plan in both cases is:
PLAN SORT (MERGE (SORT (B2 NATURAL), SORT (B NATURAL)))

This should mean no index is used, right?

Kjell

-- 
--------------------------------------
Kjell Rilbe
DataDIA AB
E-post: [email protected]
Telefon: 08-761 06 55
Mobil: 0733-44 24 64




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

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu.  Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com 

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/firebird-support/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply via email to