Subject | Re: [firebird-support] Sudden increase in execution times |
---|---|
Author | PenWin |
Post date | 2009-11-26T06:33:25Z |
Svein Erling Tysvær napsal(a):
from yesterday as well as I could and got 3.08 seconds with this
modified query! I will do more testing to be sure, but it looks very
promising indeed. Thanks a lot!
Pepak
> The only thing that I notice probably could be optimized, is that I doubt it will ever be useful to use an index for validfrom (due to your description). So, change toThat seems to solve the problem! I have recreated the 9-minute situation
>
> SELECT d.datakey, MAX(h.histkey) histkey
> FROM data d
> LEFT JOIN history h ON h.code=d.code AND h.deleted=0 AND
> h.validfrom+0<='now' AND h.validto+0>'now'
> WHERE COALESCE(d.code,0)<>COALESCE(h.code,0)
> GROUP BY d.datakey
>
from yesterday as well as I could and got 3.08 seconds with this
modified query! I will do more testing to be sure, but it looks very
promising indeed. Thanks a lot!
Pepak