The clever approach to answering this question is to do an "explain" on
the query, using a simple table (ie. the sample tables that come with
UDB) and examining the results.
If your predicate stated "where 1 = 1" then an output row would be
generated for every row in the table. A scan would be needed to generate
the correct number of output rows. If the developers of a retrieval
engine are foolish enough to look for this type of code and write
special logic to save the user from his/her own bad coding, then they
deserve the problems it can easily cause. Handling predicates in a
consistant manner, without special case code, is the way to long term
stability, consistancy, and overall performance in the retrieval engine.
Philip Sherman
Joe Weinstein wrote:
Hi. Some DBMSes are clever enough not to go to data pages if a
knowably constant search criterion is false. Is DB2 among them?
thanks,
Joe Weinstein at BEA