10.07.2015 Views

Ingres 9.2 Migration Guide - Actian

Ingres 9.2 Migration Guide - Actian

Ingres 9.2 Migration Guide - Actian

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

DBMS Server EnhancementsIn the FETCH FIRST clause, the keywords FIRST and NEXT, and the keywordsROWS and ROW are interchangeable. Because you can offset and fetch first inthe same query, NEXT is an alternative for readability. For example:OFFSET 10 FETCH NEXT 25 ROWS ONLYCached Dynamic Cursor Query PlansQuery plans for cursors defined with dynamic SELECT statements can becached and reused, rather than recompiled every time they are prepared.When a subsequent PREPARE is executed on the identical syntax, the queryplan in cache is used and the query is not re-optimized.This feature provides significant performance improvement for complexqueries.A dynamic query associated with a cursor can be cached by using the keywordREPEAT or REPEATED in the prepared select. For example:PREPARE statement_name FROM REPEATED SELECT…The configuration parameter, cache_dynamic (available in CBF or ConfigurationManager), enables or disables this feature at the server level at startup. Whenset to ON, all query plans for cursors defined with dynamic SQL will be cached,removing the need to explicitly code the REPEAT or REPEATED keyword inapplications or database procedures. The default setting is OFF.The server-level default setting can be overridden by using a SET statement ofthe form:SET [NO]CACHE_DYNAMICThe server-level setting can be overridden at the session level by using a SETSESSION statement of the form:SET SESSION [NO]CACHE_DYNAMICThe DBMSINFO function returns the current setting for the session, indicatingwhether caching is on or off. For example:SELECT DBMSINFO ('CACHE_DYNAMIC')Prior to this feature, the REPEAT or REPEATED keyword could be used onINSERT, SELECT, DELETE, and UPDATE statements coded directly in anembedded program (that is, without PREPARE or EXECUTE IMMEDIATE). Thisnew feature allows REPEATED SELECT statements to be prepared if they usecursors. The REPEATED keyword results in the caching of the query plan.150 <strong>Migration</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!