07.02.2013 Views

Best Practices for SAP BI using DB2 9 for z/OS - IBM Redbooks

Best Practices for SAP BI using DB2 9 for z/OS - IBM Redbooks

Best Practices for SAP BI using DB2 9 for z/OS - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4.7 RENAME INDEX<br />

<strong>DB2</strong> 8 <strong>for</strong> z/<strong>OS</strong> only supports RENAME TABLE. RENAME INDEX was a feature<br />

request from <strong>SAP</strong> <strong>BI</strong>, because the renaming of tables and their corresponding<br />

indexes is used within <strong>SAP</strong> <strong>BI</strong> by functions like ACR (aggregate change run).<br />

<strong>DB2</strong> 9 now supports RENAME INDEX and there<strong>for</strong>e speeds up the ACR.<br />

4.8 RANK expression<br />

Online analytical processing (OLAP) specifications provide the ability to return<br />

ranking and row numbering in<strong>for</strong>mation as a scalar value in the result of a query.<br />

<strong>DB2</strong> 9 supports the new expressions ROW CHANGE, RANK, DENSE_RANK,<br />

and ROW_NUMBER, which are sometimes referred to as OLAP-specification or<br />

window functions.<br />

RANK() returns the rank of each row within the partition of a result set. The rank<br />

of a row is one plus the number of ranks that come be<strong>for</strong>e the row in question.<br />

<strong>SAP</strong> <strong>BI</strong> uses the RANK expression <strong>for</strong> TOP-N queries.<br />

Example 4-4 displays the ranking of employees that have a total salary of more<br />

than $50,000, in order by name.<br />

Example 4-4 Example <strong>for</strong> RANK<br />

SELECT EMPNO, NAME, SALARY+BONUS AS TOTAL_SALARY,<br />

RANK() OVER(ORDER BY SALARY+BONUS DESC) AS RANK_SALARY<br />

FROM EMPLOYEES<br />

WHERE SALARY+BONUS > 50000<br />

ORDER BY NAME;<br />

<strong>SAP</strong> <strong>BI</strong> uses the RANK expression <strong>for</strong> TOP-N queries.<br />

4.9 Further <strong>DB2</strong> 9 enhancements and new features<br />

There are additional important <strong>DB2</strong> 9 enhancements and new features having no<br />

extra <strong>SAP</strong> <strong>BI</strong> specific usage but that are a general benefit <strong>for</strong> every <strong>SAP</strong> system.<br />

Some of these additional enhancements include backup and recovery, Online<br />

REORG, Universal tablespaces, Clone table support, MERGE statement, Index<br />

Compression, <strong>OS</strong>C, LOB improvements, and XML.<br />

Chapter 4. Benefits of <strong>DB2</strong> 9 <strong>for</strong> <strong>SAP</strong> <strong>BI</strong> 53

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!