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

This article also applies to the following product:

  • Microsoft OLE DB Provider for DB2 3.0

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.

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.

Resolution

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

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:

http://support.microsoft.com/contactus/?ws=supportNote 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 name

File version

File size

Date

Time

Platform

SP requirement

Db2oledb.dll

7.0.3068.0

520,016

30-Nov-2010

22:46

x86

SP2

Microsoft.hostintegration.dataaccesslibrary.dll

7.0.3068.0

2,553,752

30-Nov-2010

22:46

x86

SP2

Microsoft.hostintegration.dataaccesstool.exe

7.0.3068.0

616,336

30-Nov-2010

22:46

x86

SP2

Mseidrda.dll

7.0.3068.0

805,200

30-Nov-2010

22:46

x86

SP2

Snanls.dll

7.0.3068.0

104,272

30-Nov-2010

22:46

x86

SP2

Trnsbidi.dll

7.0.3068.0

59,728

30-Nov-2010

22:46

x86

SP2

For all supported x64-based versions of OLE DB Provider for DB2 1.0

File name

File version

File size

Date

Time

Platform

SP requirement

Service branch

Db2oledb.dll

7.0.3068.0

765,264

18-Dec-2010

00:26

x64

SP2

Not Applicable

Microsoft.hostintegration.dataaccesslibrary.dll

7.0.3068.0

2,549,656

18-Dec-2010

00:26

x64

SP2

Not Applicable

Microsoft.hostintegration.dataaccesstool.exe

7.0.3068.0

612,240

18-Dec-2010

00:26

x64

SP2

Not Applicable

Mseidrda.dll

7.0.3068.0

1,404,240

18-Dec-2010

00:25

x64

SP2

Not Applicable

Snanls.dll

7.0.3068.0

127,824

18-Dec-2010

00:26

x64

SP2

Not Applicable

Trnsbidi.dll

7.0.3068.0

67,920

18-Dec-2010

00:26

x64

SP2

Not Applicable

Db2oledb.dll

7.0.3068.0

520,016

18-Dec-2010

00:26

x86

None

SYSWOW

Mseidrda.dll

7.0.3068.0

805,200

18-Dec-2010

00:25

x86

None

SYSWOW

Snanls.dll

7.0.3068.0

104,272

18-Dec-2010

00:25

x86

None

SYSWOW

Trnsbidi.dll

7.0.3068.0

59,728

18-Dec-2010

00:26

x86

None

SYSWOW

For all supported x86-based versions of OLE DB Provider for DB2 3.0

File name

File version

File size

Date

Time

Platform

Db2oledb.dll

8.0.4308.0

628,560

13-Jan-2011

22:30

x86

Microsoft.hostintegration.dataaccesslibrary.dll

8.0.4308.0

788,376

13-Jan-2011

22:30

x86

Msdrda.dll

8.0.4308.0

898,896

13-Jan-2011

22:30

x86

For all supported x64-based versions of OLE DB Provider for DB2 3.0

File name

File version

File size

Date

Time

Platform

Service branch

Db2oledb.dll

8.0.4308.0

880,976

13-Jan-2011

22:52

x64

Not Applicable

Microsoft.hostintegration.dataaccesslibrary.dll

8.0.4308.0

788,376

13-Jan-2011

22:52

x86

Not Applicable

Msdrda.dll

8.0.4308.0

1,548,624

13-Jan-2011

22:52

x64

Not Applicable

Db2oledb.dll

8.0.4308.0

628,560

13-Jan-2011

22:30

x86

SYSWOW

Msdrda.dll

8.0.4308.0

898,896

13-Jan-2011

22:30

x86

SYSWOW

For all supported IA-64-based versions of OLE DB Provider for DB2 3.0

File name

File version

File size

Date

Time

Platform

Service branch

Db2oledb.dll

8.0.4308.0

1,721,168

13-Jan-2011

23:11

IA-64

Not Applicable

Microsoft.hostintegration.dataaccesslibrary.dll

8.0.4308.0

788,376

13-Jan-2011

23:11

x86

Not Applicable

Msdrda.dll

8.0.4308.0

2,429,776

13-Jan-2011

23:11

IA-64

Not Applicable

Db2oledb.dll

8.0.4308.0

628,560

13-Jan-2011

22:30

x86

SYSWOW

Msdrda.dll

8.0.4308.0

898,896

13-Jan-2011

22:30

x86

SYSWOW

For all supported x86-based versions of Host Integration Server 2009

File name

File version

File size

Date

Time

Platform

Db2oledb.dll

8.0.3791.2

540,496

17-Dec-2010

03:05

x86

Drdaresync.exe

8.0.3791.2

478,040

17-Dec-2010

03:05

x86

Microsoft.hostintegration.adapters.msdb2.management.dll

8.0.3791.2

407,472

17-Dec-2010

03:05

x86

Microsoft.hostintegration.adapters.msdb2.runtime.dll

8.0.3791.2

79,784

17-Dec-2010

03:05

x86

Microsoft.hostintegration.dataaccesslibrary.dll

8.0.3791.2

1,279,896

17-Dec-2010

03:05

x86

Microsoft.hostintegration.msdb2client.dll

8.0.3791.2

239,504

17-Dec-2010

03:05

x86

Msdrda.dll

8.0.3791.2

882,000

17-Dec-2010

03:05

x86

Snanls.dll

8.0.3791.2

109,392

17-Dec-2010

03:05

x86

For all supported x64-based versions of Host Integration Server 2009

File name

File version

File size

Date

Time

Platform

Service branch

Db2oledb.dll

8.0.3791.2

763,728

17-Dec-2010

03:10

x64

Not Applicable

Drdaresync.exe

8.0.3791.2

675,160

17-Dec-2010

03:10

x64

Not Applicable

Microsoft.hostintegration.adapters.msdb2.management.dll

8.0.3791.2

407,472

17-Dec-2010

03:10

x86

Not Applicable

Microsoft.hostintegration.adapters.msdb2.runtime.dll

8.0.3791.2

79,784

17-Dec-2010

03:10

x86

Not Applicable

Microsoft.hostintegration.dataaccesslibrary.dll

8.0.3791.2

1,279,896

17-Dec-2010

03:10

x86

Not Applicable

Microsoft.hostintegration.msdb2client.dll

8.0.3791.2

239,504

17-Dec-2010

03:10

x86

Not Applicable

Msdrda.dll

8.0.3791.2

1,527,632

17-Dec-2010

03:10

x64

Not Applicable

Snanls.dll

8.0.3791.2

128,336

17-Dec-2010

03:10

x64

Not Applicable

Db2oledb.dll

8.0.3791.2

540,496

17-Dec-2010

03:05

x86

SYSWOW

Msdrda.dll

8.0.3791.2

882,000

17-Dec-2010

03:05

x86

SYSWOW

Snanls.dll

8.0.3791.2

109,392

17-Dec-2010

03:05

x86

SYSWOW

For all supported x86-based versions of Host Integration Server 2010



File name

File version

File size

Date

Time

Platform

Db2oledb.dll

8.5.4257.2

640,848

17-Dec-2010

22:58

x86

Drdaresync.exe

8.5.4257.2

530,264

17-Dec-2010

22:58

x86

Microsoft.hostintegration.dataaccesslibrary.dll

8.5.4257.2

1,300,376

17-Dec-2010

22:58

x86

Microsoft.hostintegration.drdalink.dll

8.5.4257.2

58,760

17-Dec-2010

22:58

x86

Msdrda.dll

8.5.4257.2

976,720

17-Dec-2010

22:58

x86

For all supported x64-based versions of Host Integration Server 2010



Db2oledb.dll

8.5.4257.2

898,384

17-Dec-2010

23:04

x64

Drdaresync.exe

8.5.4257.2

717,656

17-Dec-2010

23:04

x64

Microsoft.hostintegration.dataaccesslibrary.dll

8.5.4257.2

1,300,376

17-Dec-2010

23:04

x86

Microsoft.hostintegration.drdalink.dll

8.5.4257.2

69,000

17-Dec-2010

23:04

x64

Msdrda.dll

8.5.4257.2

1,693,520

17-Dec-2010

23:04

x64

Note Because of file dependencies, the most recent fix for Host Integration Server 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 "Applies to" section.

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'’)  

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.

Need more help?

Expand your skills
Explore Training
Get new features first
Join Microsoft Insiders

Was this information helpful?

Thank you for your feedback!

Thank you for your feedback! It sounds like it might be helpful to connect you to one of our Office support agents.

×