Subject | Re: Very Slow Update Query |
---|---|
Author | Jack Mills |
Post date | 2011-05-26T07:58:42Z |
--- In firebird-support@yahoogroups.com, gordon@... wrote:
The problem I was trying to understand was how could 2 identical tables in 2 virtually identical databases on the same local machine have vastly different update times for the same query.
After further testing the time problem is affecting update queries on other tables in the second DB, the first DB always does the update in less time.
Your update suggestion.
update disc set area_code = ltrim(area_code) WHERE AREA_CODE < '0';
returned in a few ms & the returned plan was as shown above.
Thanks for your input
Jack
>Hi Gordon
> Quoting Jack Mills <millsjack14@...>:
>
> <SNIP>
> > The update statement is "update disc set area_code = ltrim(area_code)"
> > The returned Plan "PLAN (DISC NATURAL)"
> >
> <SNIP>
>
> I am not sure from your thread if you are only having an issue with
> this one update. Or if you have a problem with all updates on this
> database and this is just a simple example.
>
> If it is just this update, how about if you do the following instead:
>
> update disc set area_code = ltrim(area_code) WHERE AREA_CODE < '0';
>
> and get a return of PLAN (DISC INDEX (DISC_IDX1))
>
> You could also add the LTRIM to the Trigger and only have to do the
> update once.
> Then the performance would not be an issue.
>
The problem I was trying to understand was how could 2 identical tables in 2 virtually identical databases on the same local machine have vastly different update times for the same query.
After further testing the time problem is affecting update queries on other tables in the second DB, the first DB always does the update in less time.
Your update suggestion.
update disc set area_code = ltrim(area_code) WHERE AREA_CODE < '0';
returned in a few ms & the returned plan was as shown above.
Thanks for your input
Jack