19.06.2013 Views

DB2 UDB for z/OS Version 8 Performance Topics - IBM Redbooks

DB2 UDB for z/OS Version 8 Performance Topics - IBM Redbooks

DB2 UDB for z/OS Version 8 Performance Topics - IBM Redbooks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4.9.2 Conclusion<br />

The CPU increase caused by Row Level Security occurs because <strong>DB2</strong> must now access the<br />

SECLABEL column in the table, evaluate the user’s SECLABEL against the SECLABEL of<br />

the data, manage a cache of SECLABEL values, and periodically consult RACF. At a very<br />

rough level, the per<strong>for</strong>mance impact of row level security can be considered in the same<br />

ballpark as <strong>DB2</strong> data compression with less than a 5% impact <strong>for</strong> a typical online transaction<br />

but higher <strong>for</strong> a CPU-bound sequential scan.<br />

However, these CPU costs are very much dependent on the complexity of the SQL, the<br />

number and size of columns manipulated by the SQL and the number of indexes that need to<br />

be updated. Anticipate seeing more overhead with simple queries which must touch a large<br />

number of unique seclabels and users, so that the cache is ineffective, rather than complex<br />

queries. A simple table space scan returning a small number of rows can potentially<br />

experience the highest impact, even with caching.<br />

Users who have already implemented a <strong>for</strong>m of row level security in their application and want<br />

to convert to <strong>DB2</strong>’s implementation of Row Level Security should not see a high CPU<br />

increase. The applications probably are less complex and the SQL less complex and<br />

expensive to run. So, the extra cost in CPU caused by Row Level Security should be<br />

compensated by the savings in CPU resulting from a simpler application.<br />

4.9.3 Recommendations<br />

Row Level Security using MLS only has a small overhead compared to no row level security<br />

at all. In addition, the MLS Row Level Security probably out per<strong>for</strong>ms any application<br />

implementation which provides similar function. MLS Row Level Security also offers a more<br />

complete or secure solution than many application implementations of row level security.<br />

When you add MLS Row Level Security into your existing applications, or design new ones<br />

with it, you should consider the per<strong>for</strong>mance impact to the application and possibly review the<br />

physical design.<br />

The per<strong>for</strong>mance of accessing tables that contain a security label can be impacted if the<br />

SECLABEL column is not included in the indexes. The SECLABEL column is used whenever<br />

a table with Row Level Security enabled is accessed. Access paths may change as <strong>DB2</strong> must<br />

now access the SECLABEL column. An index only scan may now turn into an index plus data<br />

scan. There<strong>for</strong>e, it is a good idea to include the SECLABEL column in your existing indexes if<br />

your index design allows, especially when your queries are using index-only access today.<br />

<strong>DB2</strong> caches security labels to avoid extra calls to RACF. This caching would work best if there<br />

are a relatively small number of security labels to be checked compared with the number of<br />

rows accessed.<br />

Some application processes may also need to change to accommodate write-down<br />

processing and preserve existing SECLABEL values in the table. For example, you may need<br />

to run multiple SQL or batch jobs against a table where you would normally run a single<br />

execution. In this way, you preserve the SECLABEL values already in the table.<br />

For example, if you have an SQL process to increase everyone’s salary by 10%:<br />

UPDATE PAYROLL<br />

SET SALARY = SALARY * 1.1<br />

You need write-down authority to update the whole table. Un<strong>for</strong>tunately <strong>DB2</strong> sets ALL<br />

SECLABEL values to the one value.<br />

198 <strong>DB2</strong> <strong>UDB</strong> <strong>for</strong> z/<strong>OS</strong> <strong>Version</strong> 8 Per<strong>for</strong>mance <strong>Topics</strong>

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

Saved successfully!

Ooh no, something went wrong!