To use the abstract plan in your applications you have to either enable the abstract plan loading in the server-wide mode or enable the Abstract Plan loading for the session-level inside your application
The abstract plans that you want all applications to use must be saved in the ap_stdin group. If you want different abstract plans for different applications, you must save them in a group and associate it with a user.
To use the Abstract Plans for specific users, you enable the use of the Abstract Plan for a specific group on a session level. Therefore, if you have saved abstract plans in a specific group and you want to use them, you need to tell Adaptive Server to use the abstract plans in that group. In your application you need to add the following commands:
Note: If the abstract plan is used by many users, you must have already imported the abstract plan for each user.
Example:
set plan load group_name on
go
*some queries*
go
set plan load off
go
You can enable Adaptive Server to use the abstract plans server-wide from the default group of ap_stdin.
To use the same abstract plan for all applications, the system administrator must set the abstract plan load sp_configure parameter to 1. Adaptive Server then uses the stored abstract plans from the default group ap_stdin.
Note: You can override the use of the abstract plan from ap_stdin for a specific SQL statement with the session-level "set plan load" command in the application.
Abstract Plan Compatibility with Original SQL
Open the Abstract Plan Manager
Import an Abstract Plan for each User
The technique of creating temporary tables to extract data from permanent tables is often used. Because the existent of the local temp table is session related, you need to create these temporary tables in your current session. The User-Defined Temp Table window allows you to create temp tables to use so that you may optimize and analyze SQL statements that use temporary tables. Besides temporary table that you create using the User-Defined Temp Table window, temporary table may also be created during the scanning by the SQL Scanner and during the optimization process by the SQL Optimizer.
Note: Temporary Tables created in the User-Defined Temp Table module are not available in the SQL Worksheet module since a new database session is used to execute commands in the SQL Worksheet.
Temporary tables only exist in your current session. In order to optimize a SQL statement that uses temporary tables, these tables need to be created in this session before you optimize. The User-Defined Temp Table window allows the creation of temporary tables to be use throughout modules that use the original sessions that is created as you logon.
Temporary tables created in the User-Defined Temp Table module are used in the SQL Optimizer and SQL Scanner and can be viewed in the Database Explorer. An icon displays in the status bar of the main window to indicate at least one temporary table was created under the current session.
Temporary tables are dropped when you
Exit from the program
Reconnect with the same or a different user logon
Drop it using the User-Defined Temp Table module
To create temporary tables
Click .
Enter the SQL for creating the temporary table on the Creation tab. Multiple commands can be entered.
Click Execute.
After the temporary table is created you will notice an icon on the bottom right of the main window status. This icon disappears when all user-defined temporary tables are dropped.
The User-Defined Temp Table module only supports SQL statements that create or modify temporary tables; these are:
SELECT INTO
CREATE TABLE
CREATE INDEX
DROP INDEX
DROP TABLE
INSERT
UPDATE
DELETE
Note: Temporary tables created within the User-Defined Temp Table window can be used in all modules but the SQL Worksheet. The SQL Worksheet module creates a separate session so temporary tables created in the User-Defined Temp Table cannot be used in the SQL Worksheet and vice versa.
© 2024 Quest Software Inc. ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center