Wednesday, April 2, 2014

SAP & the new SQL 2014 Cardinality Estimator

If you're running SAP on Microsoft and are lucky enough to be current on your SQL environment, you already know SQL 2014 was released yesterday and have probably been testing the CTP for months.  Right?

Anyhow, performance and compatibility are the two areas most likely to cause issues, or pleasant results.

Some more info on the new SQL 2014 Query Optimizer.
http://blogs.msdn.com/b/saponsqlserver/archive/2014/01/16/new-functionality-in-sql-server-2014-part-2-new-cardinality-estimation.aspx

If you're running, or upgrading to Oracle 12c, changes to their DB Optimizer with Adaptive Plans could affect your performance. 

http://scn.sap.com/community/oracle/blog/2014/02/19/oracle-db-optimizer-part-x--looking-under-the-hood-of-adaptive-query-optimization-adaptive-statistics--sql-plan-directives-oracle-12c

While testing Dynamic Sampling at my previous project, I noticed that whether dropping / recreating indexes, updating statistics, or using Dynamic Sampling, you always paid for your performance someplace.  As data gets larger, the built-in scheduled maintenance jobs can no longer cope with updating large partitioned tables in a 4-hour time window.  Custom solutions may need to be implemented.

Both SQL 2014 and Oracle 12c have enhancements to partitioning strategies.  Oracle can now delay the global index maintenance on an entire table when a partition is modified.  Truncation and exchange changes can be cascaded through referenced partitioned tables.  Interval partitioning is available. Partial indexing to speed up bulk loads.

For SQL 2014, online maintenance of index partitions and lock priorities seems to be one of the biggest feature improvements for partitioning.  Incremental creation of statistics on partitioned tables could also help with availability.