Optimizing SQL query, altering ORs
<p>With below condition query executes very long time. I think it depends from <strong>or</strong> conditions. How I can alternate these <strong>or</strong>s?   </p>

<pre><code>WHERE (p.tran_number = LTRIM(RTRIM(@tran_number)) OR ISNULL(LTRIM(RTRIM(@tran_number)), '') = '')
    AND (CAST(p.fiscal_date AS DATE) &gt;= CAST(@begin_date AS DATE) OR @begin_date IS NULL)
    AND (CAST(p.fiscal_date AS DATE) &lt;= CAST(@end_date AS DATE) OR @end_date IS NULL)
    AND CAST(@end_date AS DATE)
    AND (p.operation_type = @operation_type OR @operation_type = '-1')
    AND (
           ce.username = @username
        OR @role_code LIKE '%admin%'
        OR @role_code LIKE '%Statists_GO%'
        OR (
            (ce.username IN (
                SELECT e.domain_username
                FROM @childTable c
                LEFT JOIN FstP.dbo.employees e ON e.id = c.obj_id
                    AND c.obj_type = 'employee'
            )
        )
        AND @role_code LIKE '%supervisor%')
    )
    AND (p.rnm = @rnm OR ISNULL(@rnm, '') = '')
    AND (ce.username = @author OR ISNULL(@author, '') = '')
    AND (
           d2.docs_num = @policy_number
        OR dGate.DealNumber = @policy_number
        OR ISNULL(@policy_number, '') = ''
    )
ORDER BY insert_date DESC, fiscal_date DESC
</code></pre>