Subject Re: [SPAM 4] RE: [firebird-support] Why can't I see the query plan?
Author Kjell Rilbe
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: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64



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