[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: [sqr-users] Substr on SQL in SQR



The reason this is happening is that you are forcing a tablescan - and if the 
field is not the primary key you are digging a big hole.

1) Make sure if there are any keys above your where clause you use them - even 
if there is only 1 value in the DB

2) Try using "like"  (ie where field1 like '1%')

3) better yet, us a double where clause  (where field1 >= '1' and field1 < '2')





******************************
Larry Roux
Syracuse University
lroux@syr.edu
*******************************

>>> BoettgeK@cwu.edu 11/01/02 06:54PM >>>

I added a simple WHERE clause on my SQL with the SUBSTR function.  The routine 
that normally took a minute to run has now been running for many minutes (and 
still has not completed).

Apparently, there is a lot of overhead with the SUBSTR function.  Can anyone 
confirm this.  Here is sorta what I am doing:

Select * from AFILE where substr(firstfield,1,1) = '1'

Cool... just finished. I had an 8 fold increase in execution time by adding 
this SUBSTR condition.  Is there a better way to do this?

-Ken


_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users