Oppolzer - Informatik / Blog


Blog-Hauptseite      Neuester Artikel      Älterer Artikel      Neuerer Artikel      Älterer gleiche Kategorie      Neuerer gleiche Kategorie

DB2-L - Was ist besser? BETWEEN oder Kombination aus >= und <=

Subject:

Re: AW: [DB2-L] Which is better? "BETWEEN" vs "<=" and >"="

From:

Bernd Oppolzer <bernd.oppolzer@T-ONLINE.DE>

Reply-To:

DB2 List <db2-l@lists.idug.org>

Date:

2010.01.14 18:21:00


I, too, think that there is a difference in the calculation of the filter
factors, and, probably more important, there will be different default filter
factors, if proper filter factors can not be calculated due to the use of host
variables and NOREOPT(VARS).

I always recommend to use BETWEEN, if if meets the needs of the application.

Kind regards

Bernd



W.J. schrieb:
> Hi
>
> I think, although the result set will be the same, the predicates are not equivalent,
> because they have different filtor factors and I don't believe either, that DB2 will
> rewrite these predicates. May be, DB2 can use multi-index access for the greater/less
> equal predicate. From time to time, I got different access paths when I use these predicates.
>
> But T. or P. will know all that for sure.
>
> Mit freundlichen Grüßen
> W.J.
>
>

Blog-Hauptseite      Neuester Artikel      Älterer Artikel      Neuerer Artikel      Älterer gleiche Kategorie      Neuerer gleiche Kategorie