Subject | Re: Query is running slowly for the first time. |
---|---|
Author | un_spoken |
Post date | 2012-10-08T21:06:46Z |
Thank you Sean for trying to help.
Unfortunately, that does not changed anything. I have indexed S.Data and number of records in table S is very small. I guess indexing does not really help anything here. I've tried your modyfication but the result is the same - slow for the first time, fast for the second time.
Unfortunately, that does not changed anything. I have indexed S.Data and number of records in table S is very small. I guess indexing does not really help anything here. I've tried your modyfication but the result is the same - slow for the first time, fast for the second time.
--- In firebird-support@yahoogroups.com, "Leyne, Sean" <Sean@...> wrote:
>
> Bruce,
>
> > I am having problem with the query which is constructed like this:
> >
> > SELECT S.Column1, S.Column2, STORED_PROC.Column1,
> > STORED_PROC.Column2 FROM TABLE SomeTable S LEFT JOIN
> > STORED_PROC(S.UniqueID) ON 1=1 WHERE S.Data >= '01.07.2012' AND S.Data
> > <='09.07.2012'
>
> Is S.Data indexed?
>
> If not, then I would use the following SQL:
>
> SELECT
> T.Column1, T.Column2,
> STORED_PROC.Column1,STORED_PROC.Column2
> FROM (
> SELECT
> S.UniqueID,
> S.Column1,
> S.Column2
> FROM SomeTable S
> WHERE
> S.Data BETWEEN '01.07.2012' AND '09.07.2012'
> ) T
> LEFT JOIN STORED_PROC( T.UniqueID) ON 1=1
>