Subject Re: [firebird-support] Re: SubSelect problems
Author Helen Borrie
At 11:16 AM 11/01/2005 +0000, you wrote:


> > There is no evidence that it could be. Thousands of people are using
> > v.1.5.2 without this problem. That said, a certain optimization
>I tryed this query on windows 1.5.1 results are the same. How server
>is making decision what execution plan to use? Maybe sometimes it is
>selecting different execution plan?
>
>Anyway I will try to reproduce these conditions taht is making this
>query work that slow. I understand that it is allmost imposible to say
>something without it. So this is my query, I will post more
>information lately.

Well, seeing your query immediately tells me two things:

1) Using SELECT FIRST 1 in subqueries is where your enormous read-counts
are coming from (DON'T DO IT!! - in order to find the *first* one, the
engine has to get the entire set...and it has to do it for every row.)

and
2) If you were in my software team I'd send you away with a flea in your
ear and tell you to write a decent stored procedure.

Sorry to be blunt.

./heLen

[snipped Guinness Query of the Year]