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.

Chapter 4: Additional Features to Enhance <strong>Data</strong><strong>Server</strong> Per<strong>for</strong>mance<br />

Replacing FIND FIRST <strong>for</strong> per<strong>for</strong>mance<br />

When coding ABL applications <strong>for</strong> the <strong>Data</strong><strong>Server</strong>, FIND FIRST statements can often<br />

be replaced with other ABL statements to greatly improve per<strong>for</strong>mance. OPEN QUERYs<br />

and dynamic FINDs are significantly more efficient. Likewise, using FOR FIRST in place<br />

of FIND FIRST can improve per<strong>for</strong>mance when retrieving a single record with NO-LOCK.<br />

For example, if your application uses the following FIND FIRST code:<br />

FIND FIRST tablename WHERE where-clause NO-LOCK.<br />

The code can be replaced with the following <strong>for</strong> significant per<strong>for</strong>mance gains:<br />

FOR FIRST tablename WHERE where-clause NO-LOCK:<br />

END.<br />

In the case of the FOR FIRST, the record is not reliably available beyond the end of the<br />

FOR FIRST loop unless a LEAVE is specified. Similar per<strong>for</strong>mance advantages can be<br />

gained when retrieving last record as well.<br />

180 <strong>OpenEdge</strong> <strong>Data</strong> <strong>Management</strong>: <strong>Data</strong><strong>Server</strong> <strong>for</strong> <strong>Microsoft</strong> <strong>SQL</strong> <strong>Server</strong>

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

Saved successfully!

Ooh no, something went wrong!