If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > db2 / as400 via iseries

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-07-06, 13:13
dotolee dotolee is offline
Registered User
 
Join Date: Feb 2003
Posts: 107
db2 / as400 via iseries

I'm connecting to a db2 database via iseries driver. Noticing that the first time I query for details, it's really slow. but the second / subsequent calls are faster.
can the indexes be a problem?
do i have to create a separate index for every field that is listed in my where clause?
Thanks.
Reply With Quote
  #2 (permalink)  
Old 02-07-06, 13:39
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
What 'first time' do you mean ?

Generally after you restart your DB2 database/subsystem(sorry, I don't know the correct terminology on ISeries), the data you need is not in the bufferpools ... So the 'first time' DB2 has to do physical IO ... Therefore the repsonse is much slower ...

Similarly, if you have been accessing lots of other tables, the 'first time' a query is accessing a table, physical IO similar to the one mentioed above has to happen ... Therefore it is slower ...

For the former case, if you know which set of tables/indexes is being accessed, whenever you restart db2, I would recommend running queries to access those set of tables before the end-user accesses the tables from the application and finds it slow ..

If many of these are small lookup tables that your front-end appl uses to populate, say drop-down lists, you may put all the tables to a separate bufferpool ... You may access these tables before the application does, when you restart the database .. Having these reference data in their own bufferpool also means that the larger tables will not be able to 'flush' these
tables from the bufferpool

HTH

Sathyaram

Quote:
Originally Posted by dotolee
I'm connecting to a db2 database via iseries driver. Noticing that the first time I query for details, it's really slow. but the second / subsequent calls are faster.
can the indexes be a problem?
do i have to create a separate index for every field that is listed in my where clause?
Thanks.
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 02-07-06, 14:06
dotolee dotolee is offline
Registered User
 
Join Date: Feb 2003
Posts: 107
"first time" defined

Each time the web site is launched i what I mean by the first time (even if the application has been launched by someone else)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On