Den 2012-08-13 15:29 skrev Svein Erling Tysvær såhär:
>
> >> Using FB 2.1.4 I try to tune a query that I know will take hours to
> >> execute due to large table joins etc. I usually see the query plan in
> >> FlameRobin and in Sinática Monitor, but in some cases I don't.
> >>
> >> Why can't I see the plan in some cases, and is there a different way
> >> that *would* allow me to see it?
> >
> >AFAIR, there is a limit of 32K for the PLAN and a longish IN list 
> might produce something like that.
> >
> >Also see:
> >http://tracker.firebirdsql.org/browse/CORE-2115
> >http://tracker.firebirdsql.org/browse/CORE-2116
>
> My guess is that if you add
>
> and Upg."Förrådsvärde" between 2597 and 3275
>
> to your query, then you might get a plan and hopefully not notice any 
> slowdown in execution time (you want 329 out of 679 values in this 
> range, I don't know whether the query will slow down or not by this 
> addition).
>
> There are two other alternatives ( for a) I'm assuming Thomas is right 
> and that the 32K actually include the name of the index):
>
> a) Make the name of the index for Förrådsvärde shorter
> b) Add a (temporary) table and join to this rather than use 329 fixed 
> values
>

Thank you both, SET and Thomas, for giving me some useful info and 
advice. This query turned out to execute in about 6 hours and return 
~265000 records, and importantly for my application it starts returning 
records right away. I.e. the actual query execution was short, but 
record fetch was lengthy. It would be, with that many records. :-)

I'll keep your advice in mind for future queries. The same problem has 
always popped up now and then...

Regards,
Kjell

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



[Non-text portions of this message have been removed]



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

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

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