Subject | Re: [IBDI] What's the difference? |
---|---|
Author | Vince Duggan |
Post date | 2000-06-21T07:55:28Z |
David,
The only differences are that in the former, you have control over the
name of the index (for use in PLANs), and the latter is an official
constraint, and is therefore more useful to some tools (such as CASE
tools) which may look at constraints but not at indexes.
Vince
David J N Begley wrote:
Vince Duggan
Synectics Software
Inprise C/S Business Partner
South Africa
http://www.synectics.co.za
mailto:vince@...
The only differences are that in the former, you have control over the
name of the index (for use in PLANs), and the latter is an official
constraint, and is therefore more useful to some tools (such as CASE
tools) which may look at constraints but not at indexes.
Vince
David J N Begley wrote:
>--
> Presumably this will be seen as a dumb question but I want to double-check
> anyway; what is the difference between these two statements:
>
> 1: CREATE UNIQUE ASCENDING INDEX CTL_CLIENTIDX
> ON CONTROLS (ACCOUNTANTNO, CLIENTCODE);
>
> 2: ALTER TABLE CONTROLS
> ADD UNIQUE (ACCOUNTANTNO, CLIENTCODE);
>
> The second obviously creates a key that can be subsequently referenced in
> foreign key definitions in other tables, but if you're not interested in
> establishing table relationships here just enforcing a "unique" attribute
> across a group of fields and providing an index for faster lookups, is there
> really any difference between these two statements?
>
> Presumably by creating a key (be it primary or secondary/unique) you
> automatically create some form of internal index too, right (or should a
> separate index be created for every key)?
>
> Thanks..
>
> dave
>
> ------------------------------------------------------------------------
> $BCg4V$H$O$8$a$k!"Cg4V$r8+$D$1$k!!#e%0%k!<%W(B
> $B!!!!!!!V%0%k!<%W%a!<%k$7$^$;$s$+!)!W(B
> $B%5!<%/%k!&F1Ak2q!&F1N=!&%S%8%M%9!&2HB2$G$I$&$>!*(B
> $B!!(Bhttp://www.egroups.co.jp/info/features.html
> http://click.egroups.com/1/3411/5/_/679568/_/961573952/
> ------------------------------------------------------------------------
>
> Community email addresses:
> Post message: IBDI@onelist.com
> Subscribe: IBDI-subscribe@onelist.com
> Unsubscribe: IBDI-unsubscribe@onelist.com
> List owner: IBDI-owner@onelist.com
>
> Shortcut URL to this page:
> http://www.onelist.com/community/IBDI
Vince Duggan
Synectics Software
Inprise C/S Business Partner
South Africa
http://www.synectics.co.za
mailto:vince@...