• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

query times out

Participant ,
Sep 13, 2006 Sep 13, 2006

Copy link to clipboard

Copied

The following statement in my query (see enclosed) is timing out. We are using Oracle DB and the field oth_tchname_ssn contains data such as 123456789:123456789:123456789:123456789:123456789:123456789

or b.oth_tchname_ssn like <cfqueryparam value="%#ReReplaceNoCase(socNum, '[^0-9]', '', 'All')#%" cfsqltype="CF_SQL_VARCHAR">

Any ideas?
TOPICS
Advanced techniques

Views

290

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 13, 2006 Sep 13, 2006

Copy link to clipboard

Copied

What version of Oracle, ColdFusion and database drivers are you using. If you hard code the cfqueryparam values does it run? What is your timeout set to? Does the same hardcoded query run in sqlplus or another query tool? How long does it take to run in the query tool? A little more information is needed to help you.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 13, 2006 Sep 13, 2006

Copy link to clipboard

Copied

We are using Oracle Database 10g Release 10.2.0.2.0 ,CFMX 6.1 updater, and JDBC 3.5 dirvers. I hard-coded the queryparam like this:

or oth_tchname_ssn like '%#ReReplaceNoCase(socNum, '[^0-9]', '', 'All')#%'

and it runs but takes like 185 seconds and returns 118,000 records when the table remediation only has 69,000 records and table MATHPREP_0506 has 19,000 records.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 13, 2006 Sep 13, 2006

Copy link to clipboard

Copied

So how long does this run in sqlplus or another query tool? I would expect that it takes a long time there also. You are using like and IN on 7 columns. This must cause a lot of tablescanning. You can see if indexing those columns improves performance - but 7 indices may not make sense either.

You can try it as a stored procedure also.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 13, 2006 Sep 13, 2006

Copy link to clipboard

Copied

LATEST
The problem was that the statement was missing parenthesis tags as follows:

and ('#ReReplaceNoCase(socNum, '[^0-9]', '', 'All')#'
IN (tch_socsecnum,math_tchname_ssn,eng_tchname_ssn,socstud_tchname_ssn,sci_tchname_ssn,read_tchname_ssn)
or oth_tchname_ssn like '%#ReReplaceNoCase(socNum, '[^0-9]', '', 'All')#%' )

We also indexed some columns. I will eventually swtich this to a stored procedure. It runs quite fast now.

Thanks for your help.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation