Return-Path: <oracle-l-bounce@freelists.org>
Delivered-To: 2-oracle-l@orafaq.com
Received: (qmail 13566 invoked from network); 6 Jun 2007 10:51:34 -0500
Received: from freelists-180.iquest.net (HELO turing.freelists.org) (206.53.239.180)
  by 69.64.49.119 with SMTP; 6 Jun 2007 10:51:34 -0500
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id B47816EFB23;
 Wed,  6 Jun 2007 11:49:36 -0400 (EDT)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 05340-01; Wed, 6 Jun 2007 11:49:36 -0400 (EDT)
Received: from turing (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 1CC376EEC43;
 Wed,  6 Jun 2007 11:49:36 -0400 (EDT)
Received: with ECARTIS (v1.0.0; list oracle-l); Wed, 06 Jun 2007 11:08:57 -0400 (EDT)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 25C716F121C
 for <oracle-l@freelists.org>; Wed,  6 Jun 2007 11:08:57 -0400 (EDT)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 32586-06 for <oracle-l@freelists.org>;
 Wed, 6 Jun 2007 11:08:57 -0400 (EDT)
Received: from mx02.il.proquest.com (mx02.il.proquest.com [192.195.245.52])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id C125F6F0DEF
 for <oracle-l@freelists.org>; Wed,  6 Jun 2007 11:08:56 -0400 (EDT)
X-ASG-Debug-ID: 1181142650-6ff7000a0002-JbYmij
X-Barracuda-URL: http://spam.il.proquest.com:8000/cgi-bin/mark.cgi
X-Barracuda-Connect: aabo-exchange05.bos.il.pqe[172.24.3.61]
X-Barracuda-Start-Time: 1181142650
X-ASG-Whitelist:  Client
Received: from aabo-exchange05.bos.il.pqe (aabo-exchange05.bos.il.pqe [172.24.3.61])
 by mx02.il.proquest.com (Spam Firewall) with ESMTP
 id 3CCEF1C9196; Wed,  6 Jun 2007 11:10:50 -0400 (EDT)
Received: from AABO-EXCHANGE02.bos.il.pqe ([172.24.3.202]) by aabo-exchange05.bos.il.pqe with Microsoft SMTPSVC(6.0.3790.3959);
	 Wed, 6 Jun 2007 11:09:41 -0400
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C7A84C.B5261988"
X-ASG-Orig-Subj: RE: Storing single numbers in the database
Subject: RE: Storing single numbers in the database
Date: Wed, 6 Jun 2007 11:09:38 -0400
Message-ID: <AA29A27627F842409E1D18FB19CDCF270C70CE1C@AABO-EXCHANGE02.bos.il.pqe>
In-Reply-To: <24A78E69-31EB-4CC8-893F-F19521473EF6@digistar.com>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: Storing single numbers in the database
From: "Bobak, Mark" <Mark.Bobak@il.proquest.com>
To: "Buchanan, Jason" <oracle@digistar.com>
Cc: <sbecker6925@gmail.com>,
 "Baumgartel, Paul" <paul.baumgartel@credit-suisse.com>,
 "oracle-l" <oracle-l@freelists.org>
X-OriginalArrivalTime: 06 Jun 2007 15:09:41.0627 (UTC) FILETIME=[B55054B0:01C7A84C]
X-Barracuda-Virus-Scanned: by Barracuda Spam Firewall at il.proquest.com
X-archive-position: 49518
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-to: oracle-l-bounce@freelists.org
X-original-sender: Mark.Bobak@il.proquest.com
Precedence: normal
Reply-to: Mark.Bobak@il.proquest.com
List-help: <mailto:ecartis@freelists.org?Subject=help>
List-unsubscribe: <oracle-l-request@freelists.org?Subject=unsubscribe>
List-software: Ecartis version 1.0.0
List-Id: oracle-l <oracle-l.freelists.org>
X-List-ID: oracle-l <oracle-l.freelists.org>
List-subscribe: <oracle-l-request@freelists.org?Subject=subscribe>
List-owner: <mailto:steve.adams@ixora.com.au>
List-post: <mailto:oracle-l@freelists.org>
List-archive: <http://www.freelists.org/archives/oracle-l>
X-list: oracle-l
X-Virus-Scanned: Debian amavisd-new at localhost.localdomain
------_=_NextPart_001_01C7A84C.B5261988
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi Jason,
=20
First off, the spelling error (alphanumberic) was mine, not yours!  You
spelled it correctly in the original mail, so, no that's not what I was
getting at.  ;-)
=20
My point was (and still is) that I was not aware of any conversion of
"characters into alphanumeric values and perform the sort on the
converted values".  In my quick testing yesterday, I was not able to
notice any discernable performance difference between sorting a
varchar2, char, or number column.
=20
If you do find a reference to that paper, I'd be interested in seeing
it.
=20
Thanks!
=20
-Mark
=20
=20
=20
--
Mark J. Bobak
Senior Database Administrator, System & Product Technologies
ProQuest
789 E. Eisenhower, Parkway, P.O. Box 1346
Ann Arbor MI 48106-1346
734.997.4059  or 800.521.0600 x 4059
mark.bobak@il.proquest.com <mailto:mark.bobak@il.proquest.com>=20
www.proquest.com <http://www.proquest.com/>=20
www.csa.com <http://www.csa.com/>=20

ProQuest...Start here.=20

=20

________________________________

From: Buchanan, Jason [mailto:oracle@digistar.com]=20
Sent: Tuesday, June 05, 2007 6:28 PM
To: Bobak, Mark
Cc: sbecker6925@gmail.com; Baumgartel, Paul; oracle-l
Subject: Re: Storing single numbers in the database



On Jun 5, 2007, at 5:45 PM, Bobak, Mark wrote:


	Um, Jason, what are you talking about, with regard to "...forces
the database engine to silently convert the characters to into
alphanumberic values and perform the sort on the converted values..."??
	What does that even mean?
=09
=09


I was in a rush (like I am now) while replying and had Numbers on the
brain.  I meant to say "alphanumeric" (without the "b").



	=20
	Of course, as previously discussed, if you have a non-numerical
column, and compare to a numeric literal or bind value, such as:
	select * from test_sort where varchar_values =3D '1';
	=20
	Then this will cause an implicit data conversion, and prevent a
possible index access path.
=09
=09


That's the point I was trying to make earlier.....  it was a leap of
faith assumption on my part that the original poster's point was that
this might happen.  I've had to deal with developers who stored numbers
in a varchar2 column and wondered why the sort performance of the
numbers was poor ("it must be oracle's fault" mentality).  Sandy's
original post gave me the impression that her developer was of the same
ilk; rather than put the effort into the application he is "throwing it
over the wall" to the database engine to do the work.  By itself these
operations are small but in a large environment they add up quickly.  In
a multi-character database (UTF8) the sorting performance is
considerably slower.


	=20
	However, I know of no "conversion" required when sorting a
non-numeric datatype.



Later tonight i'll have to dig up Wolfgang's paper on numeric sorts of
data stored in character-based datatypes.  The method Oracle uses to
perform a numeric sort of numerical data stored in varchar2 fields is
well documented in his paper.


thanks,
Jason





------_=_NextPart_001_01C7A84C.B5261988
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.6000.16441" name=3DGENERATOR></HEAD>
<BODY=20
style=3D"WORD-WRAP: break-word; -khtml-nbsp-mode: space; =
-khtml-line-break: after-white-space">
<DIV><SPAN class=3D250190515-06062007><FONT face=3DArial color=3D#0000ff =
size=3D2>Hi=20
Jason,</FONT></SPAN></DIV>
<DIV><SPAN class=3D250190515-06062007><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D250190515-06062007><FONT face=3DArial color=3D#0000ff =
size=3D2>First=20
off, the spelling error (alphanumberic) was mine, not yours!&nbsp; You =
spelled=20
it correctly in the original mail, so, no that's not what I was getting=20
at.&nbsp; ;-)</FONT></SPAN></DIV>
<DIV><SPAN class=3D250190515-06062007><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D250190515-06062007><FONT face=3DArial color=3D#0000ff =
size=3D2>My=20
point was (and still is) that I was not aware of any conversion of =
"characters=20
into alphanumeric values and perform the sort on the converted =
values".&nbsp; In=20
my quick testing yesterday, I was not able to notice any discernable =
performance=20
difference between sorting a varchar2, char, or number=20
column.</FONT></SPAN></DIV>
<DIV><SPAN class=3D250190515-06062007><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D250190515-06062007><FONT face=3DArial color=3D#0000ff =
size=3D2>If you=20
do find a reference to that paper, I'd be interested in seeing=20
it.</FONT></SPAN></DIV>
<DIV><SPAN class=3D250190515-06062007><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D250190515-06062007><FONT face=3DArial color=3D#0000ff =

size=3D2>Thanks!</FONT></SPAN></DIV>
<DIV><SPAN class=3D250190515-06062007><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D250190515-06062007><FONT face=3DArial color=3D#0000ff =

size=3D2>-Mark</FONT></SPAN></DIV>
<DIV><SPAN class=3D250190515-06062007><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D250190515-06062007><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV dir=3Dltr align=3Dleft><!-- Converted from text/rtf format --><SPAN =

lang=3Den-us></SPAN><SPAN lang=3Den-us><B><FONT face=3DArial =
size=3D1>--<BR>Mark J.=20
Bobak</FONT></B></SPAN><SPAN lang=3Den-us><BR></SPAN><SPAN =
lang=3Den-us><B><FONT=20
face=3DArial size=3D1>Senior Database Administrator, System &amp; =
Product=20
Technologies</FONT></B></SPAN><SPAN lang=3Den-us><BR></SPAN><SPAN =
lang=3Den-us><FONT=20
face=3DArial size=3D1>ProQuest</FONT></SPAN><SPAN =
lang=3Den-us><BR></SPAN><SPAN=20
lang=3Den-us><FONT face=3DArial size=3D1>789 E. Eisenhower, Parkway, =
P.O. Box=20
1346</FONT></SPAN><SPAN lang=3Den-us><BR></SPAN><SPAN lang=3Den-us><FONT =
face=3DArial=20
size=3D1>Ann Arbor MI 48106-1346</FONT></SPAN><SPAN =
lang=3Den-us><BR></SPAN><SPAN=20
lang=3Den-us><FONT face=3DArial size=3D1>734.997.4059&nbsp; or =
800.521.0600 x=20
4059</FONT></SPAN><SPAN lang=3Den-us><BR></SPAN><A=20
href=3D"mailto:mark.bobak@il.proquest.com"><SPAN =
lang=3Den-us></SPAN><SPAN=20
lang=3Den-us><U><FONT face=3DArial color=3D#0000ff=20
size=3D1>mark.bobak</FONT></U></SPAN><SPAN lang=3Den-us></SPAN><SPAN=20
lang=3Den-us><U><FONT face=3DArial color=3D#0000ff=20
size=3D1>@il.proquest.com</FONT></U></SPAN><SPAN =
lang=3Den-us></SPAN></A><SPAN=20
lang=3Den-us><BR></SPAN><A href=3D"http://www.proquest.com/"><SPAN=20
lang=3Den-us></SPAN><SPAN lang=3Den-us><U><FONT face=3DArial =
color=3D#0000ff=20
size=3D1>www.proquest.com</FONT></U></SPAN><SPAN =
lang=3Den-us></SPAN></A><SPAN=20
lang=3Den-us><BR></SPAN><A href=3D"http://www.csa.com/"><SPAN=20
lang=3Den-us></SPAN><SPAN lang=3Den-us><U><FONT face=3DArial =
color=3D#0000ff=20
size=3D1>www.csa.com</FONT></U></SPAN><SPAN =
lang=3Den-us></SPAN></A><SPAN=20
lang=3Den-us><BR><BR></SPAN><SPAN lang=3Den-us><B><FONT face=3DArial=20
size=3D2>ProQuest...</FONT></B></SPAN><SPAN lang=3Den-us></SPAN><SPAN=20
lang=3Den-us><FONT face=3DArial size=3D2>Start here.</FONT></SPAN><SPAN=20
lang=3Den-us></SPAN> </DIV>
<P dir=3Dltr><SPAN lang=3Den-us></SPAN><SPAN lang=3Den-us></SPAN></P>
<DIV>&nbsp;</DIV><BR>
<DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr align=3Dleft>
<HR tabIndex=3D-1>
<FONT face=3DTahoma size=3D2><B>From:</B> Buchanan, Jason=20
[mailto:oracle@digistar.com] <BR><B>Sent:</B> Tuesday, June 05, 2007 =
6:28=20
PM<BR><B>To:</B> Bobak, Mark<BR><B>Cc:</B> sbecker6925@gmail.com; =
Baumgartel,=20
Paul; oracle-l<BR><B>Subject:</B> Re: Storing single numbers in the=20
database<BR></FONT><BR></DIV>
<DIV></DIV><BR>
<DIV>
<DIV>On Jun 5, 2007, at 5:45 PM, Bobak, Mark wrote:</DIV><BR=20
class=3DApple-interchange-newline>
<BLOCKQUOTE type=3D"cite">
  <DIV><SPAN class=3D734163721-05062007><FONT face=3DArial =
color=3D#0000ff size=3D2>Um,=20
  Jason, what are you talking about, with regard to "...forces the =
database=20
  engine to silently convert the characters to into alphanumberic values =
and=20
  perform the sort on the converted values..."??</FONT></SPAN></DIV>
  <DIV><SPAN class=3D734163721-05062007><FONT face=3DArial =
color=3D#0000ff size=3D2>What=20
  does that even mean?</FONT></SPAN></DIV>
  <DIV><SPAN class=3D734163721-05062007><FONT face=3DArial =
color=3D#0000ff=20
  size=3D2></FONT></SPAN><BR></DIV></BLOCKQUOTE>
<DIV><BR class=3Dkhtml-block-placeholder></DIV>
<DIV>I was in a rush (like I am now) while replying and had Numbers on =
the=20
brain.&nbsp; I meant to say "alphanumeric" (without the "b").</DIV>
<DIV><BR class=3Dkhtml-block-placeholder></DIV><BR>
<BLOCKQUOTE type=3D"cite">
  <DIV>&nbsp;</DIV>
  <DIV><SPAN class=3D734163721-05062007><FONT face=3DArial =
color=3D#0000ff size=3D2>Of=20
  course, as previously discussed, if you have a non-numerical column, =
and=20
  compare to a numeric literal or bind value, such =
as:</FONT></SPAN></DIV>
  <DIV><SPAN class=3D734163721-05062007><FONT face=3DArial =
color=3D#0000ff=20
  size=3D2>select * from test_sort where varchar_values =3D =
'1';</FONT></SPAN></DIV>
  <DIV><SPAN class=3D734163721-05062007><FONT face=3DArial =
color=3D#0000ff=20
  size=3D2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=3D734163721-05062007><FONT face=3DArial =
color=3D#0000ff size=3D2>Then=20
  this will cause an implicit data conversion, and prevent a possible =
index=20
  access path.</FONT></SPAN></DIV>
  <DIV><SPAN class=3D734163721-05062007><FONT face=3DArial =
color=3D#0000ff=20
  size=3D2></FONT></SPAN><BR></DIV></BLOCKQUOTE>
<DIV><BR class=3Dkhtml-block-placeholder></DIV>
<DIV>That's the point I was trying to make earlier.....&nbsp; it was a =
leap of=20
faith assumption on my part that the original poster's point was that =
this might=20
happen.&nbsp; I've had to deal with developers who stored numbers in a =
varchar2=20
column and wondered why the sort performance of the numbers was poor =
("it must=20
be oracle's fault" mentality).&nbsp; Sandy's original post gave me the=20
impression that her developer was of the same ilk; rather than put the =
effort=20
into the application he is "throwing it over the wall" to the database =
engine to=20
do the work.&nbsp; By itself these operations are small but in a large=20
environment they add up quickly.&nbsp; In a multi-character database =
(UTF8) the=20
sorting performance is considerably slower.</DIV><BR>
<BLOCKQUOTE type=3D"cite">
  <DIV>&nbsp;</DIV>
  <DIV><SPAN class=3D734163721-05062007><FONT face=3DArial =
color=3D#0000ff=20
  size=3D2>However, I know of no "conversion" required when sorting a =
non-numeric=20
  datatype.</FONT></SPAN></DIV></BLOCKQUOTE>
<DIV><BR class=3Dkhtml-block-placeholder></DIV>
<DIV><BR class=3Dkhtml-block-placeholder></DIV>
<DIV>Later tonight i'll have to dig up Wolfgang's paper on numeric sorts =
of data=20
stored in character-based datatypes.&nbsp; The method Oracle uses to =
perform a=20
numeric sort of numerical data stored in varchar2 fields is well =
documented in=20
his paper.</DIV>
<DIV><BR class=3Dkhtml-block-placeholder></DIV>
<DIV><BR class=3Dkhtml-block-placeholder></DIV>
<DIV>thanks,</DIV>
<DIV>Jason</DIV>
<DIV><BR class=3Dkhtml-block-placeholder></DIV><BR></DIV>
<DIV><BR class=3Dkhtml-block-placeholder></DIV><BR></BODY></HTML>

------_=_NextPart_001_01C7A84C.B5261988--
--
http://www.freelists.org/webpage/oracle-l


