Tony,

My guess is that there is an index on the orderno field
but it is a 'varchar' index (as it should be)

because the string you are comparing to is an int, it's
probably converting each orderno to int and comparing that way.
(I would think the opposite though)

so because there is no, 'int' index for that column, then
it table scans.

just a punting guess.


> -----Original Message-----
> From: Tony Schreiber [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 3 April 2003 8:58 AM
> To: CF-Talk
> Subject: Learned something today (Oracle)
> 
> 
> I couldn't understand why some queries on tables selecting using the
> primary key (orderno) was taking so long...
> 
> In this instance the field in the database is a varchar 
> field, but it's
> holding a numeric value. (Don't ask me why, that's another discussion)
> 
> If I did the query like this:
> 
> SELECT FROM orderheader WHERE orderno = 60134445
> 
> It took like 40 secs!
> 
> If I did the query like this:
> 
> SELECT FROM orderheader WHERE orderno = '60134445'
> 
> Bam! tiny milliseconds... Like it should be.
> 
> I never realized that the (lack of) quotes was the problem. 
> What causes
> this slowdown exactly?
> 
> 
> Tony Schreiber, Senior Partner                  Man and 
> Machine, Limited
> mailto:[EMAIL PROTECTED]                   
> http://www.technocraft.com
> 
> http://www.is300.net The Enthusiast's Home of the Lexus IS300 
> since 1999
> http://www.simplemessageboard.com    Free Forum Software for 
> Cold Fusion
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to