Subject RE: [firebird-support] Specifying multiple plans
Author Rick Debay
Sorry, I couldn't test as my actual query is more complex and uses a
view. The plan generated by Firebird refers to indexes within the view,
but when I try to use it with the query I get an error message that the
index is for a table that is not in the query (of course not, it's
hidden within the view).

It turns out I don't need to specify a plan. If I remove the problem
constraint (which was to return results on only one customer) it returns
100 times quicker, and it's easy within Crystal Reports to only display
the customer I care about.

-----Original Message-----
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Vlad Horsun
Sent: Thursday, January 04, 2007 4:03 PM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] Specifying multiple plans

> Select statements generate multiple plans, if the select contains
> further selects.
> I need to specify my own plan for such a select statement, but I get
> an error on the second plan:
>
> SELECT
> *
> FROM
> FEE
> WHERE
> NOT EXISTS (SELECT 1 FROM FI WHERE FO = FEE.FUM); PLAN (FEE I_GOLD)
> PLAN (FI I_EGG) <-- Token unknown - char 1 PLAN

Try

SELECT
*
FROM
FEE
WHERE
NOT EXISTS (SELECT 1 FROM FI WHERE FO = FEE.FUM PLAN (FI I_EGG) )
PLAN (FEE I_GOLD)


> Also, would an ORDER BY go after or before PLAN?

I don't remember - but you can try both by yourself ;)

Regards,
Vlad


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

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




Disclaimer: This message (including attachments) is confidential and may be privileged. If you have received it by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorized use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change. RxStrategies, Inc. shall not be liable for the improper or incomplete transmission of the information contained in this communication or for any delay in its receipt or damage to your system. RxStrategies, Inc. does not guarantee that the integrity of this communication has been maintained nor that this communication is free from viruses, interceptions or interference.