Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email firstname.lastname@example.org
Optimizer IN or IN question
From: Zeugswetter Andreas DAZ SD (ZeugswetterAspardat.at)
Date: Thu Jul 28 2005 - 02:24:32 CDT
I have the following question (MaxDB 7.5), with the following statement:
select * from bsis where mandt=? and bukrs=? and
(hkont in (?,?,?,?) or hkont in (?,?,?) or hkont in (?,?,?));
The table has a PK on mandt, bukrs, hkont, ...
When I do not use parameters maxdb uses 'DIFFERENT STRATEGIES FOR
and uses hkont in the PK index.
When I use parameters, hkont is not used as a 'RANGE CONDITION'. I guess
because without knowing values the different sets may overlap. Without
as index condition, the statement is very inefficient because mandt and
is not selective.
But, could MaxDB not automatically simplify above query to "hkont in
(especially if it is written as stupid and simple as above :-) ?
I am going to adapt the query, but still wanted to ask.
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb