このクエリは完璧に機能すると思います。それ以外はとても遅いです。私は何を間違っていますか?コード全般で速度を向上させるにはどうすればよいですか?
<sql:query var="UserQuery" dataSource="jdbc/UBWT">
SELECT top 100
dbo.v_r_system.Name0 as PC,
dbo.v_computer_owners_preferred.User_ID as UBOCUBID,
dbo.v_r_user.User_Name0 as UBID,
dbo.v_r_user.ResourceID as ResID,
dbo.v_r_user.displayName0 as FoolName,
dbo.v_r_user.givenName0 as FirstName,
dbo.v_r_user.sn0 as LastName,
dbo.v_r_user.mail0 as eMail,
dbo.v_computer_owners_preferred.Recent_Login_TimeStamp as InFor,
dbo.v_r_user.departmentNumber0 as DeptNum,
dbo.v_r_user.department0 as Dept,
dbo.v_r_user.telephoneNumber0 as Phone
FROM
dbo.v_r_system
inner join dbo.v_computer_owners_preferred on dbo.v_r_system.name0 = dbo.v_computer_owners_preferred.computer_name
inner join dbo.v_r_user on dbo.v_computer_owners_preferred.user_id = dbo.v_r_user.unique_user_name0
where dbo.v_r_system.Name0 = ? <sql:param value="${param.ubid}" />
or dbo.v_computer_owners_preferred.User_ID = ? <sql:param value="${param.ubid}" />
or dbo.v_r_user.User_Name0 = ? <sql:param value="${param.ubid}" />
or dbo.v_r_user.displayName0 = ? <sql:param value="${param.ubid}" />
or dbo.v_r_user.telephoneNumber0 = ? <sql:param value="${param.ubid}" />
order by dbo.v_computer_owners_preferred.Recent_Login_TimeStamp desc;
私は本当にすべてのOR
ステートメントが好きではありません。ある種の準備済みステートメントに変換する必要がありますか?