Wow, sorry about all the white space spacing... odd

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@bama.ua.edu] On
Behalf Of George, William@FTB
Sent: Thursday, April 19, 2012 3:23 PM
To: IBM-MAIN@bama.ua.edu
Subject: DB2 Fetch Behind the Scenes

Note: I did attempt to send this to the DB2 group but it bounced back at
me so I'll send it here to IBM-MAIN and attempt to figure out what went
wrong with my DB2 auth.

DB2 internals type of question.

ISSUE
We have a process that returns table rows matching on a masked name. The
"LIKE" predict is used with a wildcard to return the matching names.
We, not surprisingly, are experiencing time outs in our CICS region when
the mask is rather open ended. For example:  LIKE "%AND%.  There are
several million names in the database.  

We are now limiting the cursor to stop after 50 names have been returned
but we still see some time outs.  

MAIN QUESTION
Does the cursor, prior to returning any results, compile all the results
before hand?  Meaning, even though we have limited to cursor loop to 50
is it still compiling the thousands of results in the background?  Would
at FETCH FIRST help in this case?  Something else?

ADDITIONAL QUESTION
Is there a better method than the LIKE predict?  The name column is part
of an index and is the lead column.

We are contemplating removing the beginning wildcard.  LIKE 'AND%'.
This we figure should help but doesn't give the user as much
flexibility.

Any insights on main question would be much appreciated.

Thanks

Bill

 

______________________________________________________________________
CONFIDENTIALITY NOTICE: This email from the State of California is for
the sole use of the intended recipient and may contain confidential and
privileged information. Any unauthorized review or use, including
disclosure or distribution, is prohibited. If you are not the intended
recipient, please contact the sender and destroy all copies of this
email.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send
email to lists...@bama.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN

Reply via email to