Subject | Re: Better procedure for "horizontal table"? |
---|---|
Author | rsaeger.edv@t-online.de |
Post date | 2001-09-06T10:56:47Z |
--- In ib-support@y..., Svein Erling Tysvær
<svein.erling.tysvaer@k...> wrote:
WHERE DateField BETWEEN Date1 AND Date2 uses indexes, but EXTRACT
(MONTH FROM DateField) doesn't.
IMHO the problem isn't the call of EOM procedure, the problem is
twelvetimes SELECT SUM(... for every employee in the main-query, 100
employees = 1200 x SELECT SUM(... :-(
I'm thinking about this since 2 days, but I cannot find a better
solution.
Regards
Richard
<svein.erling.tysvaer@k...> wrote:
> Seems pretty OK to me, but then I don't know very much about SPs.Do you
> have an index on (Work_Day, Emp_No)?Yes, there are this indexes .
> I guess you could save a little bit by not calling EOM - after closefirst of
> examination I have found that it will always be the day before the
> the following month ;-)Yes, it is right. EOM returns the End Of Month date. I've found, that
>
> HTH,
> Set
WHERE DateField BETWEEN Date1 AND Date2 uses indexes, but EXTRACT
(MONTH FROM DateField) doesn't.
IMHO the problem isn't the call of EOM procedure, the problem is
twelvetimes SELECT SUM(... for every employee in the main-query, 100
employees = 1200 x SELECT SUM(... :-(
I'm thinking about this since 2 days, but I cannot find a better
solution.
Regards
Richard