In Oracle, you don't need quotes for varchar fields. This is perfectly valid:
where foo = hello However, this breaks: where foo = hello there Anyhoo, what probably's happening is that Oracle is caching your resultset, so that when you run it again, it comes back super fast. ----- Original Message ----- From: Tony Schreiber <[EMAIL PROTECTED]> Date: Wednesday, April 2, 2003 3:58 pm 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'sholding 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 > causesthis slowdown exactly? > > > Tony Schreiber, Senior Partner Man and Machine, > Limitedmailto:[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 Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

