Microsoft KB Archive/919474

= FIX: If a SQL Server linked server uses Host Integration Server 2004 Microsoft OLE DB Provider for DB2, the query execution time may be slower than expected when the query uses a four-part name syntax =

Article ID: 919474

Article Last Modified on 12/4/2007

-

APPLIES TO


 * Microsoft Host Integration Server 2004 Standard Edition
 * Microsoft Host Integration Server 2004 Enterprise Edition
 * Microsoft OLE DB Provider for DB2

-



SYMPTOMS
Consider the following scenario. You perform a query against an IBM DB2 database. The query uses a four-part name syntax. In this scenario, the query execution time may be slower than expected.

For example, the query execution time may be slower than expected when you perform a query that resembles the following: SELECT * FROM LINKED_SERVER.CATALOG1.SCHEMA1.DB2_TABLE WHERE COLUMN1 = '12345' If the query uses the OPENQUERY syntax, the query execution time is faster than if the query uses a four-part name syntax. For example, the query execution time is faster when you perform a query that resembles the following: SELECT * FROM OPENQUERY(LINKED_SERVER, ‘SELECT * FROM SCHEMA1.DB2_TABLE WHERE COLUMN1 = '12345'’) You experience this problem if a Microsoft SQL Server linked server uses Microsoft Host Integration Server 2004 Microsoft OLE DB Provider for DB2 to access the IBM DB2 database.



CAUSE
The following list describes the common reasons that this problem may occur:
 * The distributed query processor in SQL Server may execute the query statement multiple times. Each execution of the query statement adds to the overall query execution time.
 * The format of the query statement may cause some of the execution or all the execution to be performed locally by SQL Server instead of remotely on the IBM DB2 system. This may include query statements that include WHERE clauses or LIKE clauses. Therefore, more query data may be returned to SQL Server than is required for the particular query.



Hotfix information
A supported hotfix is now available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next service pack that contains this hotfix.

To resolve this problem, submit a request to Microsoft Online Customer Services to obtain the hotfix. To submit an online request to obtain the hotfix, visit the following Microsoft Web site:

http://go.microsoft.com/?linkid=6294451

Note If additional issues occur or any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. To create a separate service request, visit the following Microsoft Web site:

http://support.microsoft.com/contactus/?ws=support

File information
The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.

Note Because of file dependencies, the most recent hotfix that contains these files may also contain additional files.

Hotfix information
A supported hotfix is now available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next service pack that contains this hotfix.

To resolve this problem, submit a request to Microsoft Online Customer Services to obtain the hotfix. To submit an online request to obtain the hotfix, visit the following Microsoft Web site:

http://go.microsoft.com/?linkid=6294451

Note If additional issues occur or any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. To create a separate service request, visit the following Microsoft Web site:

http://support.microsoft.com/contactus/?ws=support

File information
The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.

32-bit x86-based version

64-bit x64-based version

Note Because of file dependencies, the most recent hotfix that contains these files may also contain additional files.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.



MORE INFORMATION
This hotfix is designed to address the second reason that is described in the &quot;Cause&quot; section.

Microsoft OLE DB Provider for DB2 has been updated to support a writeable DBPROP_MAXROWS property. Therefore, SQL Server may retrieve less query data when SQL Server runs a four-part name query. Before you apply this hotfix, Microsoft OLE DB Provider for DB2 exposes the DBPROP_MAXROWS property as a read-only property. This read-only property has a default value of 0. Because the DBPROP_MAXROWS property is set to 0, SQL Server retrieves the whole table every time that a data query call is made.

The updated DBPROP_MAXROWS property that is included in this hotfix lets the distributed query processor in SQL Server set this property to 1. If this property is set to 1, SQL Server retrieves a limited number of rows of data from the IBM DB2 database instead of retrieving the whole table. Therefore, the four-part name query finishes running sooner.

Note The performance improvement that you experience depends on the format of the four-part name query together with the specific environment in which Microsoft OLE DB Provider for DB2 is used.

For more information about the DBPROP_MAXROWS property, visit the following Microsoft Developer Network (MSDN) Web site:

http://msdn2.microsoft.com/en-us/library/ms723104.aspx

For more information, click the following article number to view the article in the Microsoft Knowledge Base:

824684 Description of the standard terminology that is used to describe Microsoft software updates

The third-party products that this article discusses are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding the performance or reliability of these products.

Additional query words: DQP 4-part OLEDB

Keywords: kbbug kbfix kbqfe kbpubtypekc kbhotfixserver KB919474

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.