Chapter 16: Shared Query Plans

Adaptive Server versions 15.7 ESD #2 and later allow you to share query plans, avoiding the need for Adaptive Server to create or recompile query plans that are identical to existing plans. Shared query plans are cloned from primary query plans under concurrent system.

Use sp_configure to enable Adaptive Server to use shared query plans. The syntax is:

sp_configure 'enable plan sharing', 1

enable plan sharing is part of the enable functionality group. See the System Administration Guide, Volume 1 for information about setting parameters that are part of this group.

You should see a performance improvement as Adaptive Server shares query plans instead of reusing or recompiling them. You may see a slight change to procedure cache memory usage as primary query plans are pinned in the cache while Adaptive Server uses their shared query plans.

For a query plan to be shareable:

The show_cached_plan_in_xml function describes the sharing of plans under the <planSharing> element.