Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: 2 Oracle doubts

Re: 2 Oracle doubts

From: Joel Garry <joel-garry_at_home.com>
Date: 25 Jul 2003 14:02:08 -0700
Message-ID: <91884734.0307251302.73fc32c2@posting.google.com>


Karsten Farrell <kfarrell_at_belgariad.com> wrote in message news:<MPG.198b01e758561e9f989807_at_news.la.sbcglobal.net>...
> Hi delavega, thanks for writing this:
> > Hi. I´m a MySql programmer, but i need make a application with Oracle
> > 8.1 Server. I have 2 doubts (for the moment)
> >
> > 1- Can i have a Oracle table without primary Key?
> > 2- In a sql, the date fields are with quotas ("")? Exists the
> > direct comparation between dates (<, >)?
> >
> > Thanks!
> >
>
> Several posts have asked why you want a table without a primary key. In a
> pure "data design" sense, that's a good question. However, in implementing
> a physical representation of your logical design, it's sometimes prudent
> to have a table without a primary key.
>
> For example, we have a table that contains the two-character state
> abbreviation and its spelled-out (long) name. Unless something very
> unusual happens in the USA, there are only 52 rows in this table. Of
> course, I could use the state abbreviation as the PK (since it will be
> unique), or even use a sequence, but doing so would cause Oracle to
> generate an index for it. Now I know that all 52 states will easily fit in
> an Oracle block, so the optimizer will never use the index ... which means
> I've wasted space (not a lot of space, mind you).

52? Oops! http://www.usps.com/cpim/ftp/pubs/pub201/yourmail.htm#abbr  :-) (I'm totally curious what you missed - I assume you got DC and maybe PR?)

I occasionally have tables without keys because I find it much faster to deal with large quantities of data outside of Oracle (as opposed to humongous joins), then put it into a table for report purposes - which will necessarily be full scanned. But of course when it comes down to it, this is due to bad design further upstream, that I'm stuck with. And when it comes to maintenance, well... aren't Oracle people supposed to know shell scripting? :-)

jg

--
@home.com is bogus.
http://www.cnn.com/2003/TECH/internet/07/23/cybercafe.security.ap/index.html
Received on Fri Jul 25 2003 - 16:02:08 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US