Quantcast
Channel: SCN: Message List - SAP Advantage Database Server
Viewing all articles
Browse latest Browse all 997

Re: ADS 11.10.0.24 Performance Issue

$
0
0

OR clauses are always difficult.

Maybe you can build the statement dynamically or make two cases out of it (untested, just to give you an idea what I am talking about):

 

//Run the script to test the issue

DECLARE@InputAccountNumber integer;
DECLARE@InputPostingDate date;

@InputPostingDate =null;
@InputAccountNumber = 1;


if @InputAccountNumber isnull then
  select*
  from#TEMP
  where(@InputPostingDate isnullor PostingDate <=@InputPostingDate )

else

  select*
  from#TEMP
  where(AccountNumber = @InputAccountNumber)
  and(@InputPostingDate isnullor PostingDate <=@InputPostingDate )

end if


Viewing all articles
Browse latest Browse all 997

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>