13.01.2013 Views

OpenEdge Data Management: DataServer for Microsoft SQL Server

OpenEdge Data Management: DataServer for Microsoft SQL Server

OpenEdge Data Management: DataServer for Microsoft SQL Server

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Firehose and Fast Forward-Only Cursors<br />

Enhancements overview<br />

Firehose cursors deliver a streamlined, unmanaged, client-side cursor-processing mechanism<br />

<strong>for</strong> handling result sets from a <strong>Data</strong><strong>Server</strong> query. When connection pooling is enabled, firehose<br />

cursors are the default mechanism <strong>for</strong> handling read-only results. If a firehose cursor is denied<br />

to an application, the <strong>Data</strong><strong>Server</strong> first attempts to substitute a Fast Forward-Only (FFO)<br />

server-side cursor with Auto-Fetch and Auto-Close attributes in its place. If the query cannot be<br />

handled by a FFO cursor, the cursor is further downgraded.<br />

Firehose cursors<br />

Firehose cursors are identified in <strong>Microsoft</strong> <strong>SQL</strong> <strong>Server</strong> as the default result set. A default result<br />

set is generated when the statement attributes of a cursor are left unchanged from their standard<br />

MS <strong>SQL</strong> defaults. The default result set allows rows from a query result to be pulled without<br />

locks in <strong>for</strong>ward-only sequence into a client-side cache. The default result set is referred to as a<br />

firehose cursor because it can “flood” the client with results. It is unencumbered by the cursor<br />

management necessary with server-side cursors.<br />

The following <strong>Data</strong><strong>Server</strong> operations are eligible <strong>for</strong> the firehose cursor implementation:<br />

• All NO-LOCK queries.<br />

• All SHARE-LOCK queries with transaction isolation level set to read-uncommitted.<br />

• Internal no-lock queries that populate the key cache <strong>for</strong> transaction-oriented operations.<br />

• All stored procedure result sets.<br />

• All send-sql-statement result sets.<br />

• Queries written with the QUERY-TUNING(SEPARATE-CONNECTION) keyword. When<br />

connection pooling is enabled, the QUERY-TUNING(SEPARATE-CONNECTION) is redundant.<br />

Note: Prepared statements associated with firehose cursors are now cached on a statement<br />

cache that is associated with the managed connection. Statement reuse may decrease<br />

based on the recycling of managed connections. To completely disable the prepared<br />

statement cache, use the following connection switch: “-Dsrv PRGRS_PREPCACHE,0”.<br />

For in<strong>for</strong>mation on monitoring the statement cache reuse, see the “Monitoring cursor<br />

and connection use” section on page 4–6.<br />

Firehose exclusions<br />

Certain statements and fields automatically exclude a query from consideration <strong>for</strong> a firehose<br />

cursor. Two examples are:<br />

• FOR FIRST and FOR LAST statements. Because these statements return at most one row,<br />

they are optimized with the Transact-<strong>SQL</strong> keyword TOP, which renders them ineligible <strong>for</strong><br />

a firehose cursor.<br />

• Queries that include text or image fields that translate to <strong>SQL</strong> LONGVARCHAR and<br />

LONGVARBINARY data types. If possible, use field lists to exclude these fields from your<br />

result set.<br />

4–5

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

Saved successfully!

Ooh no, something went wrong!