Subject | Re: Query Optimiser |
---|---|
Author | paulhope@allcomm.co.uk |
Post date | 2001-01-15T22:30:31Z |
Jason
it would be a mess - the example was only one 'whereitem' of about
10! The technique seems to provide a very powerful way of preparing
data in response to a user input screen with many optional selection
criteria and where the data comes from multiple tables and can
benefit from server-side manipulation.
Regards
Paul
> If you are in a stored procedure I suggest that you use an IF ( )THEN and
> make two totally separate statements and get rid of the OR totally.I think
> somehow the OR prevents use of the index.before as
>
> I would be curious to know why since I have battled this issue
> well.I havn't used IF THEN because there are too many selection option and
>
it would be a mess - the example was only one 'whereitem' of about
10! The technique seems to provide a very powerful way of preparing
data in response to a user input screen with many optional selection
criteria and where the data comes from multiple tables and can
benefit from server-side manipulation.
Regards
Paul
>query
> ----- Original Message -----
> From: <paulhope@a...>
> To: <IB-Architect@egroups.com>
> Sent: Monday, January 15, 2001 6:43 AM
> Subject: [IB-Architect] Query Optimiser
>
>
> > I've discovered recently that a technique I use for getting the
> > inability to
> > create dynamic SQL in a stored procedure creates problems with
> > plans.suggesting?
> > (Still using 5.6 but I assume the same applies in 6)
> >
> > If I have select . . from . . where invoice_number>=:INVNO -- the
> > plan uses
> > the index, but
> > select . . from . . where ((-1=:INVNO)or(invoice_number>=:INVNO))
> > doesn't
> > and the extraction is very slow.
> >
> > Is this a horrible thing to do or is an enhancement worth
> >
> > Regards
> > Paul