Archives of the TeradataForum
Message Posted: Tue, 20 Feb 2007 @ 19:41:51 GMT
Subj: | | Re: SUBSTR query |
|
From: | | Anomy Anom |
<-- Anonymously Posted: Tuesday, February 20, 2007 14:44 -->
Use something like
CASE WHEN index (mst_fn, '-') > 0
THEN index (mst_fn, '-')
ELSE 0
END
within the SUBSTR to avoid -1. Or try moving the index (mst_fn, '-') > 0
and index (gst_fn, '-') > 0 conditions to the start of the WHERE clause.
In general the optimizer is free to reorder the execution of predicates. Perhaps such optimizations are more likely for SELECT than UPDATE, or
maybe you just got lucky.
|