Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 16 Sep 2002 @ 06:17:35 GMT


     
  <Prev Next>  
<<First
<Prev
Next>
Last>>
 


Subj:   Resolving obvious predicates in query
 
From:   Anantaraman, Kumaran (K.)

This is an offshoot of my previous question on topic 'all in all'.

explain
select *
from table1
where
  UPI_COL = value
  OR
  4 = 5
;

The explain shows a FTS.

The predicate '4 = 5' is obviously FALSE, and the above query can be rewritten without it. Then, the optimizer efficiently uses the UPI.

Why cannot the optimizer make such preliminary evaluations and transform the query? Do other RDBMS optimizers take any such steps?

Just in case you are wondering who would code such SQL, please see previous topic 'all in all'.

Kumaran Anantaraman



     
  <Prev Next>  
<<First
<Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023