Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 Linked Server to db2 (iSeries) question

Author  Topic 

snufse
Constraint Violating Yak Guru

469 Posts

Posted - 2008-11-05 : 10:25:53
I have defined the iSeries as a linked server on a MS Sql server running Sequel 2005 linking to db2 (iSeries). I am issuing a sequel command like this:


SELECT     gbmcu, gbsub
FROM OPENQUERY(AS400SRV_IBMDASQL_OLEDB,
'SELECT * from vgiprddta.f0902lc')
WHERE gbmcu = ' 1100281'


After 20 minutes the query is still executing. I cancel

When I issue the command on the iSeries like this:

select * from f0902lc where gbmcu = ' 1100281'

The response time is about 1 second.

The table has approx 17 millons record. The file I am using have a key = my selection.

Any ideas???

Could it be that sequel does not use the indexed file on the iSeries and loops through the file sequentially?

I also tried using providers IBMDA400 and IBMDASQL with same result.

NeilG
Aged Yak Warrior

530 Posts

Posted - 2008-11-05 : 10:53:55
if the server is defined as a linked server would you not issue a query like

select *
from iseries.DatabaseName.dbo.tableName
where gbmcu = ' 1100281'
Go to Top of Page

snufse
Constraint Violating Yak Guru

469 Posts

Posted - 2008-11-05 : 11:20:19
I guess you can do it either way. The code I have works for other files (and even this file if I omit the "where" clause).
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-11-05 : 11:25:28
See Execution plan. Do you have index on gbmcu in DB2?
Go to Top of Page
   

- Advertisement -