473,383 Members | 1,922 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

AS400 - Ado.Net from Vb.Net Slow Query Times

Hello all!

I'm having a problem with a project I'm working on and I'd like to ask
for anyone's input that might be helpful. I'm building a rather large
front-end application connecting to an AS400 for the back end database
and I'm experiencing slow response times when executing sql statements.
Some select statement response times are bad. Not all, but some. And
there doesn't seem to be a consistent factor in any of the sql
statements being so slow.

Based on the application design, there's a group of components that get
loaded dynamically which all access tables on the AS400. So it's very
possible that the same sql statement will execute 40 or 50 times. My
issue here is that for one execution of a select statement, it may take
50 - 200 milliseconds to execute. Cumulatively, assuming 50 executions
of the statement, you're looking at a worse case scenario of 10 seconds
(and it's even run longer, believe me). Even some INSERTs, UPDATEs and
DELETEs are also slow.

I'm using the iSeries Access v5r3 ole-db drivers. Keep in mind that
these access times are slow even when there are no users on the box, so
CPU usage is not an issue here. Although the slowdown becomes even
more evident when the CPU is at 40% or higher.

At this point the file sizes are very small (50-200 records in a file,
and even less for lookup tables). The files are indexed according to
the fields specified in the order of the where and order by clauses.

Unfortunately I can't use the managed provider due to our legacy file
structures using char for fields. The char field definition inherently
has spaces after the end of it. It would muck up our code too much to
trim each time we need to do a field comparison or a field assignment.
The managed provider from ibm doesn't trim trailing spaces. The ole-db
provider does trim trailing spaces.

Does anyone have any idea why SQL on the AS400 is this slow for me? I
have quite a bit of experience developing SQL Server applications in
Vb.Net and I've never experienced poor response times like this.

Can anyone direct me to a faster data provider? Or is there some
tuning parameters I can use for IBM's AS400 provider?

Any help would be very much appreciated.

Thanks!
Chris Voveris
Programmer / Analyst
Penn Software and Technology Services, Inc.

Nov 21 '05 #1
6 6681
Hi,
Which provider are you using ? IBMDA400 ?
If not, it's at least worth giving a try.

"MadMan2004" <cv**********@cs.com> a écrit dans le message de news: 11**********************@g14g2000cwa.googlegroups. com...
Hello all!

I'm having a problem with a project I'm working on and I'd like to ask
for anyone's input that might be helpful. I'm building a rather large
front-end application connecting to an AS400 for the back end database
and I'm experiencing slow response times when executing sql statements.
Some select statement response times are bad. Not all, but some. And
there doesn't seem to be a consistent factor in any of the sql
statements being so slow.

Based on the application design, there's a group of components that get
loaded dynamically which all access tables on the AS400. So it's very
possible that the same sql statement will execute 40 or 50 times. My
issue here is that for one execution of a select statement, it may take
50 - 200 milliseconds to execute. Cumulatively, assuming 50 executions
of the statement, you're looking at a worse case scenario of 10 seconds
(and it's even run longer, believe me). Even some INSERTs, UPDATEs and
DELETEs are also slow.

I'm using the iSeries Access v5r3 ole-db drivers. Keep in mind that
these access times are slow even when there are no users on the box, so
CPU usage is not an issue here. Although the slowdown becomes even
more evident when the CPU is at 40% or higher.

At this point the file sizes are very small (50-200 records in a file,
and even less for lookup tables). The files are indexed according to
the fields specified in the order of the where and order by clauses.

Unfortunately I can't use the managed provider due to our legacy file
structures using char for fields. The char field definition inherently
has spaces after the end of it. It would muck up our code too much to
trim each time we need to do a field comparison or a field assignment.
The managed provider from ibm doesn't trim trailing spaces. The ole-db
provider does trim trailing spaces.

Does anyone have any idea why SQL on the AS400 is this slow for me? I
have quite a bit of experience developing SQL Server applications in
Vb.Net and I've never experienced poor response times like this.

Can anyone direct me to a faster data provider? Or is there some
tuning parameters I can use for IBM's AS400 provider?

Any help would be very much appreciated.

Thanks!
Chris Voveris
Programmer / Analyst
Penn Software and Technology Services, Inc.

Nov 21 '05 #2
I've tried the IBMDA400 and the IBMDASQL driver. Unfortunately the
IBMDA400 is the one I'm having the poor performace with.

Thanks!
Chris

Nov 21 '05 #3
You could read this, maybe a lead.
http://www.aivosto.com/vbtips/stringopt.html
"MadMan2004" <cv**********@cs.com> a écrit dans le message de news: 11**********************@g14g2000cwa.googlegroups. com...
I've tried the IBMDA400 and the IBMDASQL driver. Unfortunately the
IBMDA400 is the one I'm having the poor performace with.

Thanks!
Chris

Nov 21 '05 #4
I checked out the website. Unfortunately, as near as I can tell, the
problem seems to be in the communication between the AS400 and the
Vb.Net app - or in the processing of the SQL statement.

However, if I execute the same statement over and over again with the
same where clause, performance usually improves. But in any real-world
application I have written, the sql statements usually vary in their
where clause.

Thanks anyway!
Chris Voveris
Programmer / Analyst
Penn Software and Technology Services, Inc.

Nov 21 '05 #5
Have you tuned your SQL on the iSeries? My experience has been that
ANY new SQL application on the iSeries must be tuned prior to releasing
it to the end users.
This is not an easy exercise and requires time, effort and basic
understanding of DB2 optimization on the iSeries. Once the developer
puts the time in, application usually rolls out just fine.
Changes that developer would make is sql syntax, creating perfect
indexes, sizing memory pools appropriately etc.

One possible problem is if the production environment is significantly
different from development environment. It doesn't sound like this is
the case in your situation.
Your comment on SQL statement running better when you run it more than
once tells me that the fact that SQL cache (job or system level) is
doing its job by preserving the access plan for your statements. If
you want to force this type of approach, you could by using SQL
packages on the iSeries. Basically you would turn extended dynamic
support for your application data source and run it through as many
variations of the SQL statements as possible, purpose being to populate
the SQL package with most commonly used SQL queries. Best use for SQL
package is if your applications uses parameter markers, as statements
would not be treated as different just due to the fact that user is
using different values for the parameters.

Hope that helps.

<vendor on>
We have a pair of tools that build on IBM's database monitor technology
and are premier tools for SQL tuning for DB2 UDB for iSeries:
insure/INDEX and insure/ANALYSIS.

http://www.centerfieldtechnology.com
<vendor off>

Elvis

Nov 21 '05 #6
Chris,
Two things to watch out for:

1. Opening new connections. Each time you create a new connection to the
AS400 its going to cost, a lot. If you can open a single connection & reuse
it. If v5r3 supports connection pooling (earlier versions did not) then use
it, if v5r3 doesn't, then I would recommend you hold onto the connection
yourself.

2. Not using "prepared" statements. If you can structure your SQL so that it
uses parameter markers & prepare the statement before executing it. your
performance should improve.
--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"MadMan2004" <cv**********@cs.comwrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
| Hello all!
|
| I'm having a problem with a project I'm working on and I'd like to ask
| for anyone's input that might be helpful. I'm building a rather large
| front-end application connecting to an AS400 for the back end database
| and I'm experiencing slow response times when executing sql statements.
| Some select statement response times are bad. Not all, but some. And
| there doesn't seem to be a consistent factor in any of the sql
| statements being so slow.
|
| Based on the application design, there's a group of components that get
| loaded dynamically which all access tables on the AS400. So it's very
| possible that the same sql statement will execute 40 or 50 times. My
| issue here is that for one execution of a select statement, it may take
| 50 - 200 milliseconds to execute. Cumulatively, assuming 50 executions
| of the statement, you're looking at a worse case scenario of 10 seconds
| (and it's even run longer, believe me). Even some INSERTs, UPDATEs and
| DELETEs are also slow.
|
| I'm using the iSeries Access v5r3 ole-db drivers. Keep in mind that
| these access times are slow even when there are no users on the box, so
| CPU usage is not an issue here. Although the slowdown becomes even
| more evident when the CPU is at 40% or higher.
|
| At this point the file sizes are very small (50-200 records in a file,
| and even less for lookup tables). The files are indexed according to
| the fields specified in the order of the where and order by clauses.
|
| Unfortunately I can't use the managed provider due to our legacy file
| structures using char for fields. The char field definition inherently
| has spaces after the end of it. It would muck up our code too much to
| trim each time we need to do a field comparison or a field assignment.
| The managed provider from ibm doesn't trim trailing spaces. The ole-db
| provider does trim trailing spaces.
|
| Does anyone have any idea why SQL on the AS400 is this slow for me? I
| have quite a bit of experience developing SQL Server applications in
| Vb.Net and I've never experienced poor response times like this.
|
| Can anyone direct me to a faster data provider? Or is there some
| tuning parameters I can use for IBM's AS400 provider?
|
| Any help would be very much appreciated.
|
| Thanks!
| Chris Voveris
| Programmer / Analyst
| Penn Software and Technology Services, Inc.
|
Jul 16 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Timo | last post by:
I just got a new dual opteron system, with raid 01, 2gb ram, and fedora core linux running 2.4.22-smp kernel. For some reason mysql is running pathetically slow. Queries that should take 2ms...
3
by: fn | last post by:
Can anyone help me understand what it takes to define a Linked Server connection to an IBM eSeries (AS400)? Do I need Microsoft's SNA Server or some other product or can I simply do it with the...
2
by: Niyazi | last post by:
Hi, I have to retrieve a data from AS400 DB2 and after working with data I have to export into one of existing Excel file. I can connect into specific library in AS400 DB2 using AS400...
2
by: Amanda | last post by:
From a guy in Microsoft newsgroups: | In *comp.databases.ibm-db2* there are always IBM guys | from the Toronto labs on line.Post with the | -for the love of god please help- | line...
14
by: Brad Allison | last post by:
Sorry to repeat myself if this is the same question I asked in the past, but I have finally made a connection to our AS400 through ODBC. I tried to get the connection using the data connection...
4
by: Brad Allison | last post by:
I posted this to the adonet newsgroup and was recommended to post here. Thank you for any help: Okay, I need a bit of advice. I have an ODBC data adapter being filled by AS400 which is very...
11
by: Andy_Khosravi | last post by:
My problem: I'm having trouble with a query taking much too long to run; a query without any criteria evaluating only 650 records takes over 300 seconds to run (over the network. On local drive...
50
by: diffuser78 | last post by:
I have just started to learn python. Some said that its slow. Can somebody pin point the issue. Thans
2
by: existential.philosophy | last post by:
This is a new problem for me: I have some queries that open very slowly in design view. My benchmark query takes about 20 minutes to open in design view. That same query takes about 20 minutes...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.