Subject Re: [firebird-support] Re: Slow query when using ORDER BY
Author Helen Borrie
At 09:45 AM 7/02/2006, you wrote:
>--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@...> wrote:
> > If the ordering is essential, how does this one go?
>
>That works beautifully except that there may be multiple corresponding
>records in ITEMINFORMAT which is why I was using the joins otherwise I
>get an error saying 'multiple rows in singleton select'

Then theoretically, you need another WHERE criterion in that
subquery, or a Max() or other appropriate expression, to ensure you
only get one possible result (or null). If that's not possible then
you've got a normalisation problem in this structure, which possibly
accounts for the extreme slowness of your original "fast" version
(not including the probable wrong result sets potentially returned.)

,/heLen