Is there orderno field a VARCHAR(2) or an number field? If it's a VARCHAR, then it is supposed to be surrounded in quotes. If it's numeric, it should not be in quotes (I don't even think it WOULD work).
> -----Original Message----- > From: Tony Schreiber [mailto:[EMAIL PROTECTED] > Sent: Wednesday, April 02, 2003 5:58 PM > 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