If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Help on Informix (IDS 7.3x) database design

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-19-03, 00:00
sengchoon sengchoon is offline
Registered User
 
Join Date: Aug 2002
Posts: 21
Smile Help on Informix (IDS 7.3x) database design

I need your advice on this matter:

[1]. What is the different between specifying 'primary key constraint' during table creation (together in the same schema) and creating 'unique index key' after table table has been created?

[2]. Referring to the question [1] above, which provide better performance e.g.
(a) --> create empty table (without any primary
key or index)
--> load data into table
--> create index.

-or-

(b) --> create empty table (with primary key
specified
--> load data into table
--> create index
Reply With Quote
  #2 (permalink)  
Old 12-19-03, 09:53
gurey gurey is offline
Registered User
 
Join Date: Aug 2003
Location: Argentina
Posts: 780
Re: Help on Informix (IDS 7.3x) database design

Quote:
Originally posted by sengchoon
I need your advice on this matter:

[1]. What is the different between specifying 'primary key constraint' during table creation (together in the same schema) and creating 'unique index key' after table table has been created?

[2]. Referring to the question [1] above, which provide better performance e.g.
(a) --> create empty table (without any primary
key or index)
--> load data into table
--> create index.

-or-

(b) --> create empty table (with primary key
specified
--> load data into table
--> create index
Hi,

I suggest you that:
For this case, create table with primary key "disabled", next load data, next run "set constraints for "table" enabled, next create all index and next run update statistics for "table" with distributions.

Gustavo.
Reply With Quote
  #3 (permalink)  
Old 12-19-03, 10:09
sengchoon sengchoon is offline
Registered User
 
Join Date: Aug 2002
Posts: 21
Re: Help on Informix (IDS 7.3x) database design

What is the purpose of "set constraints for "table" enabled you've mentioned. And also what is the purpose "with distributions" means? Actually, I'm still beginner in this term.


Quote:
Originally posted by gurey
Hi,

I suggest you that:
For this case, create table with primary key "disabled", next load data, next run "set constraints for "table" enabled, next create all index and next run update statistics for "table" with distributions.

Gustavo.

Last edited by sengchoon; 12-19-03 at 10:11.
Reply With Quote
  #4 (permalink)  
Old 12-19-03, 10:22
gurey gurey is offline
Registered User
 
Join Date: Aug 2003
Location: Argentina
Posts: 780
Re: Help on Informix (IDS 7.3x) database design

Quote:
Originally posted by sengchoon
What is the purpose of "set constraints for "table" enabled you've mentioned. And also what is the purpose "with distributions" means? Actually, I'm still beginner in this term.
Hi,

Ok, for example:
create table xxxx
( col1 smallint not null primary key pk_col1 disabled,
col2 integer,
.......
)

This create the table with the primary key but not create the index.
Next you can load data and next enabled the primary key, then now the index is created.
During load of data, none index is used, then load fastest.

Gustavo.
Reply With Quote
  #5 (permalink)  
Old 12-19-03, 21:34
sengchoon sengchoon is offline
Registered User
 
Join Date: Aug 2002
Posts: 21
Re: Help on Informix (IDS 7.3x) database design

Hi, how to enable primary key back?


Quote:
Originally posted by gurey
Hi,

Ok, for example:
create table xxxx
( col1 smallint not null primary key pk_col1 disabled,
col2 integer,
.......
)

This create the table with the primary key but not create the index.
Next you can load data and next enabled the primary key, then now the index is created.
During load of data, none index is used, then load fastest.

Gustavo.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On