Вопрос

We have an AS400 mainframe running our DB2 transactional database. We also have a SQL Server setup that gets loaded nightly with data from the AS400. The SQL Server setup is for reporting.

I can link the two database servers, BUT, there's concern about how big a performance hit DB2 might suffer from queries coming from SQL Server.

Basically, the fear is that if we start hitting DB2 with queries from SQL Server we'll bog down the transactional system and screw up orders and shipping.

Thanks in advance for any knowledge that can be shared.

Это было полезно?

Решение

Anyone who has a pat answer for a performance question is wrong :-) The appropriate answer is always 'it depends.' Performance tuning is best done via measure, change one variable, repeat.

DB2 for i shouldn't even notice if someone executes a 1,000 row SELECT statement. Take Benny's suggestion and run one while the IBM i side watch. If they want a hint, use WRKACTJOB and sort on the Int column. That represents the interactive response time. I'd guess that the query will be complete before they have time to notice that it was active.

If that seems unacceptable to the management, then perhaps offer to test it before or after hours, where it can't possibly impact interactive performance.

As an aside, the RPG guys can create Excel spreadsheets on the fly too. Scott Klement published some RPG wrappers over the Java POI/HSSF classes. Also, Giovanni Perrotti at Easy400.net has some examples of providing an Excel spreadsheet from a web page.

Другие советы

I'd mostly agree with Buck, a 1000 row result set is no big deal...

Unless of course the system is looking through billions of rows across hundreds of tables to get the 1000 rows you are interested in.

Assuming a useful index exists, 1000 rows shouldn't be a big deal. If you have IBM i Access for Windows installed, there's a component of System i Navigator called "Run SQL Scripts" that includes "Visual Explain" that provides a visual explanation of the query execution plan. View that you can ensure that an index is being used.

On key thing, make sure the work is being done on the i. When using a standard linked table MS SQL Server will attempt to pull back all the rows then do it's own "where".

select * from MYLINK.MYIBMI.MYLIB.MYTABE where MYKEYFLD = '00335';

Whereas this format sends the statement to the remote server for processing and just gets back the results:

select * from openquery(MYLINK, 'select * from mylib.mytable where MYKEYFLD = ''00335''');

Alternately, you could ask the i guys to build you a stored procedure that you can call to get back the results you are looking for. Personally, that's my preferred method.

Charles

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top