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.

Join by <strong>SQL</strong>DB<br />

FOR EACH customer, EACH order<br />

WHERE customer.custnum = order.custnum AND customer.custnum GT 100:<br />

However, <strong>for</strong> the following query, the <strong>Data</strong><strong>Server</strong> instructs the client to per<strong>for</strong>m the join<br />

because of the OR option:<br />

FOR EACH customer, EACH order<br />

WHERE customer.custnum = order.custnum OR customer.custnum GT 100:<br />

By default, the <strong>Data</strong><strong>Server</strong> instructs a MS <strong>SQL</strong> <strong>Server</strong> data source to per<strong>for</strong>m a join when<br />

possible and when desirable. However, you can control the default behavior by using either the<br />

QUERY–TUNING NO–JOIN–BY–<strong>SQL</strong>DB phrase or the <strong>Server</strong> Join (-nojoinbysqldb) startup<br />

parameter. The QUERY–TUNING phrase controls the behavior <strong>for</strong> a single query. The<br />

-nojoinbysqldb parameter controls it at the session level. The query-level setting overrides the<br />

session-level setting.<br />

Table 4–2 describes how these controls interact and affect the behavior.<br />

Table 4–2: Controlling join by <strong>SQL</strong>DB behavior<br />

QUERY–TUNING Startup Parameter Behavior<br />

JOIN–BY–<strong>SQL</strong>DB -nojoinbysqldb The MS <strong>SQL</strong> <strong>Server</strong> data source<br />

per<strong>for</strong>ms the join if possible.<br />

JOIN–BY–<strong>SQL</strong>DB None The MS <strong>SQL</strong> <strong>Server</strong> data source<br />

per<strong>for</strong>ms the join if possible.<br />

NO–JOIN–BY–<strong>SQL</strong>DB -nojoinbysqldb The client per<strong>for</strong>ms the join.<br />

NO–JOIN–BY–<strong>SQL</strong>DB None The client per<strong>for</strong>ms the join.<br />

None -nojoinbysqldb The client per<strong>for</strong>ms the join.<br />

None None The MS <strong>SQL</strong> <strong>Server</strong> data source<br />

per<strong>for</strong>ms the join if possible and the<br />

join contains the selection criteria<br />

described previously.<br />

A join by <strong>SQL</strong>DB does not occur by default <strong>for</strong> the following query because the <strong>Data</strong><strong>Server</strong><br />

determines that it does not increase per<strong>for</strong>mance:<br />

FOR EACH customer, EACH order:<br />

You receive a warning if you specify JOIN–BY–<strong>SQL</strong>DB when the MS <strong>SQL</strong> <strong>Server</strong> data source<br />

cannot per<strong>for</strong>m the join and the <strong>Data</strong><strong>Server</strong> per<strong>for</strong>ms the join instead. You receive a warning at<br />

compile time if you specify JOIN–BY–<strong>SQL</strong>DB when the data source can per<strong>for</strong>m the join but it is<br />

not optimal <strong>for</strong> it to do so.<br />

4–15

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

Saved successfully!

Ooh no, something went wrong!