Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: Four-part name query that contains a WHERE clause may run slowly on a SQL Server linked server that uses OLE DB Provider for DB2 to connect to a DB2 system


View products that this article applies to.

This article also applies to the following product: 
  • Microsoft OLE DB Provider for DB2 3.0

↑ Back to the top


Symptoms

Consider the following scenario:
  • You install Microsoft OLE DB Provider for DB2 on a computer.
  • You have a Microsoft SQL Server linked server that uses OLE DB Provider for DB2 to connect to an instance of an IBM DB2 system.
  • You run a query on the SQL Server linked server. The query uses a four-part name syntax and a WHERE clause to query a complex DB2 view against IBM DB2 databases.
In this scenario, the query may run slowly.

Note This issue may also occur when the query is not used to query DB2 views.

↑ Back to the top


Cause

This issue occurs because OLE DB Provider for DB2 does not use a WHERE clause in a SELECT * FROM < …> query.

When the provider tries to obtain the schema information, the provider sends a SELECT * FROM < …> statement. The Distributed Query Processor (DQP) provides an OpenRowset call for OLE DB Provider for DB2 to obtain the schema information for the four-part name query. The OpenRowset call uses the DBPROP_MAXROWS property. You can set a nonzero value for the DBPROP_MAXROWS property to limit the number of rows that are returned in the query. However, OLE DB Provider for DB2 ignores the DBPROP_MAXROWS property, and the WHERE clause is removed from the SELECT * FROM < …> statement before it is sent to the IBM DB2 database. Therefore, DB2 might be slow to return the query results if the SELECT * FROM < …> query is complex.

↑ Back to the top


Resolution

A hotfix is currently not available for Microsoft OLE DB Provider for DB2 2.0.

↑ Back to the top


Hotfix information

A supported hotfix is 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 the problem described in this article. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.

If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, contact Microsoft Customer Service and Support to obtain the hotfix.

Note If additional issues occur or if 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. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft website: Note The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.


Prerequisites

  • To apply the hotfix for Microsoft OLE DB Provider for DB2 1.0, you must have OLE DB Provider for DB2 1.0 Service Pack 1 (SP1) installed. 
  • To apply the hotfix for Microsoft OLE DB Provider for DB2 3.0, you must have OLE DB Provider for DB2 3.0 installed.
  • To apply the hotfix for Microsoft Host Integration Server 2009, you must have Host Integration Server 2009 installed.
  • To apply the hotfix for Microsoft Host Integration Server 2010, you must have Host Integration Server 2010 installed.

Notes

Restart requirement

You do not have to restart the computer after you apply this hotfix.

Hotfix replacement information

This hotfix does not replace any other hotfix.

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.

For all supported x86-based versions of OLE DB Provider for DB2 1.0
File nameFile versionFile sizeDateTimePlatformSP requirement
Db2oledb.dll7.0.3068.0520,01630-Nov-201022:46x86SP2
Microsoft.hostintegration.dataaccesslibrary.dll7.0.3068.02,553,75230-Nov-201022:46x86SP2
Microsoft.hostintegration.dataaccesstool.exe7.0.3068.0616,33630-Nov-201022:46x86SP2
Mseidrda.dll7.0.3068.0805,20030-Nov-201022:46x86SP2
Snanls.dll7.0.3068.0104,27230-Nov-201022:46x86SP2
Trnsbidi.dll7.0.3068.059,72830-Nov-201022:46x86SP2
For all supported x64-based versions of OLE DB Provider for DB2 1.0
File nameFile versionFile sizeDateTimePlatformSP requirementService branch
Db2oledb.dll7.0.3068.0765,26418-Dec-201000:26x64SP2Not Applicable
Microsoft.hostintegration.dataaccesslibrary.dll7.0.3068.02,549,65618-Dec-201000:26x64SP2Not Applicable
Microsoft.hostintegration.dataaccesstool.exe7.0.3068.0612,24018-Dec-201000:26x64SP2Not Applicable
Mseidrda.dll7.0.3068.01,404,24018-Dec-201000:25x64SP2Not Applicable
Snanls.dll7.0.3068.0127,82418-Dec-201000:26x64SP2Not Applicable
Trnsbidi.dll7.0.3068.067,92018-Dec-201000:26x64SP2Not Applicable
Db2oledb.dll7.0.3068.0520,01618-Dec-201000:26x86NoneSYSWOW
Mseidrda.dll7.0.3068.0805,20018-Dec-201000:25x86NoneSYSWOW
Snanls.dll7.0.3068.0104,27218-Dec-201000:25x86NoneSYSWOW
Trnsbidi.dll7.0.3068.059,72818-Dec-201000:26x86NoneSYSWOW
For all supported x86-based versions of OLE DB Provider for DB2 3.0
File nameFile versionFile sizeDateTimePlatform
Db2oledb.dll8.0.4308.0628,56013-Jan-201122:30x86
Microsoft.hostintegration.dataaccesslibrary.dll8.0.4308.0788,37613-Jan-201122:30x86
Msdrda.dll8.0.4308.0898,89613-Jan-201122:30x86
For all supported x64-based versions of OLE DB Provider for DB2 3.0
File nameFile versionFile sizeDateTimePlatformService branch
Db2oledb.dll8.0.4308.0880,97613-Jan-201122:52x64Not Applicable
Microsoft.hostintegration.dataaccesslibrary.dll8.0.4308.0788,37613-Jan-201122:52x86Not Applicable
Msdrda.dll8.0.4308.01,548,62413-Jan-201122:52x64Not Applicable
Db2oledb.dll8.0.4308.0628,56013-Jan-201122:30x86SYSWOW
Msdrda.dll8.0.4308.0898,89613-Jan-201122:30x86SYSWOW
For all supported IA-64-based versions of OLE DB Provider for DB2 3.0
File nameFile versionFile sizeDateTimePlatformService branch
Db2oledb.dll8.0.4308.01,721,16813-Jan-201123:11IA-64Not Applicable
Microsoft.hostintegration.dataaccesslibrary.dll8.0.4308.0788,37613-Jan-201123:11x86Not Applicable
Msdrda.dll8.0.4308.02,429,77613-Jan-201123:11IA-64Not Applicable
Db2oledb.dll8.0.4308.0628,56013-Jan-201122:30x86SYSWOW
Msdrda.dll8.0.4308.0898,89613-Jan-201122:30x86SYSWOW
For all supported x86-based versions of Host Integration Server 2009
File nameFile versionFile sizeDateTimePlatform
Db2oledb.dll8.0.3791.2540,49617-Dec-201003:05x86
Drdaresync.exe8.0.3791.2478,04017-Dec-201003:05x86
Microsoft.hostintegration.adapters.msdb2.management.dll8.0.3791.2407,47217-Dec-201003:05x86
Microsoft.hostintegration.adapters.msdb2.runtime.dll8.0.3791.279,78417-Dec-201003:05x86
Microsoft.hostintegration.dataaccesslibrary.dll8.0.3791.21,279,89617-Dec-201003:05x86
Microsoft.hostintegration.msdb2client.dll8.0.3791.2239,50417-Dec-201003:05x86
Msdrda.dll8.0.3791.2882,00017-Dec-201003:05x86
Snanls.dll8.0.3791.2109,39217-Dec-201003:05x86
For all supported x64-based versions of Host Integration Server 2009
File nameFile versionFile sizeDateTimePlatformService branch
Db2oledb.dll8.0.3791.2763,72817-Dec-201003:10x64Not Applicable
Drdaresync.exe8.0.3791.2675,16017-Dec-201003:10x64Not Applicable
Microsoft.hostintegration.adapters.msdb2.management.dll8.0.3791.2407,47217-Dec-201003:10x86Not Applicable
Microsoft.hostintegration.adapters.msdb2.runtime.dll8.0.3791.279,78417-Dec-201003:10x86Not Applicable
Microsoft.hostintegration.dataaccesslibrary.dll8.0.3791.21,279,89617-Dec-201003:10x86Not Applicable
Microsoft.hostintegration.msdb2client.dll8.0.3791.2239,50417-Dec-201003:10x86Not Applicable
Msdrda.dll8.0.3791.21,527,63217-Dec-201003:10x64Not Applicable
Snanls.dll8.0.3791.2128,33617-Dec-201003:10x64Not Applicable
Db2oledb.dll8.0.3791.2540,49617-Dec-201003:05x86SYSWOW
Msdrda.dll8.0.3791.2882,00017-Dec-201003:05x86SYSWOW
Snanls.dll8.0.3791.2109,39217-Dec-201003:05x86SYSWOW
For all supported x86-based versions of Host Integration Server 2010

File nameFile versionFile sizeDateTimePlatform
Db2oledb.dll8.5.4257.2640,84817-Dec-201022:58x86
Drdaresync.exe8.5.4257.2530,26417-Dec-201022:58x86
Microsoft.hostintegration.dataaccesslibrary.dll8.5.4257.21,300,37617-Dec-201022:58x86
Microsoft.hostintegration.drdalink.dll8.5.4257.258,76017-Dec-201022:58x86
Msdrda.dll8.5.4257.2976,72017-Dec-201022:58x86
For all supported x64-based versions of Host Integration Server 2010

Db2oledb.dll8.5.4257.2898,38417-Dec-201023:04x64
Drdaresync.exe8.5.4257.2717,65617-Dec-201023:04x64
Microsoft.hostintegration.dataaccesslibrary.dll8.5.4257.21,300,37617-Dec-201023:04x86
Microsoft.hostintegration.drdalink.dll8.5.4257.269,00017-Dec-201023:04x64
Msdrda.dll8.5.4257.21,693,52017-Dec-201023:04x64
Note Because of file dependencies, the most recent fix for Host Integration Server that contains these files may also contain additional files.

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

↑ Back to the top


Workaround

To work around this issue, use an OPENQUERY function instead of a four-part name in the query.

For example, the query may run slowly when you run a query that resembles the following.

SELECT * FROM LINKED_SERVER.CATALOG1.SCHEMA1.DB2_VIEW WHERE COLUMN1 = '12345' 
This query runs faster when it uses the OPENQUERY function and resembles the following:
SELECT * FROM OPENQUERY(LINKED_SERVER, ‘SELECT * FROM SCHEMA1.DB2_VIEW  WHERE COLUMN1 = '12345'’)  

↑ Back to the top


More Information

After you apply this update, OLE DB Provider for DB2 sends a query that resembles the following if the OpenRowset call includes a nonzero value for DBPROP_MAXROWS:
SELECT * FROM tablename  FETCH FIRST nRows ROWS ONLY 

If the DBPROP_MAXROWS property is set to 0, OLE DB Provider for DB2 sends the following query to obtain the schema information, and this query might run slowly:

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

↑ Back to the top


Keywords: kbautohotfix, kbqfe, kbhotfixserver, kbfix, kbexpertiseadvanced, kbsurveynew, kb

↑ Back to the top

Article Info
Article ID : 2464256
Revision : 2
Created on : 4/10/2020
Published on : 4/10/2020
Exists online : False
Views : 381