Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: which column type char,varchar2 is better for index?
Note in-line
-- Regards Jonathan Lewis http://www.jlcomp.demon.co.uk http://www.jlcomp.demon.co.uk/faq/ind_faq.html The Co-operative Oracle Users' FAQ http://www.jlcomp.demon.co.uk/seminar.html Optimising Oracle Seminar - schedule updated May 1st "Mark D Powell" <Mark.Powell_at_eds.com> wrote in message news:2687bb95.0406110545.e66f62f_at_posting.google.com...Received on Sat Jun 12 2004 - 05:25:52 CDT
>
> When you test number verse varchar2 you should find very little
> practical difference though numeric key access should prove to be a
> little faster. At least it did when an Oracle support analyst posted
> some test results a couple years back.
>
There are two different scenarios, though. The speed of accessing a given amount of data, and the estimated cardinality for the where clause that is supposed to identify the data. Representing numeric (or date) information as character columns can cause the optimiser to get wildly inaccurate estimates of cardinality and therefore choose the wrong execution path. (Which brings you back to the performance question from a different direction).