dbTalk Databases Forums  

set constraints <xx> enabled

comp.databases.informix comp.databases.informix


Discuss set constraints <xx> enabled in the comp.databases.informix forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tom Lehr
 
Posts: n/a

Default set constraints <xx> enabled - 09-22-2011 , 02:00 PM






hello

we have a primary key disabled (from schema)

alter table attri add constraint primary key
(id)
constraint pk_attri_id
disabled;

after (re)enabling this primary key, does the table need update stats
run over it?

thanks

Reply With Quote
  #2  
Old   
Art Kagel
 
Posts: n/a

Default Re: set constraints <xx> enabled - 09-22-2011 , 02:42 PM






Not just because you enabled the constraint, no. On the other hand, if it
was disabled so you could more quickly insert lots of rows, then maybe,
probably, you need to update statistics. If the distribution of key values
for the inserted rows is statistically similar to the original distribution
of key values in the table when the stats were last updated (so the same
percentage of rows have each key value as before the load), then the stats
are probably good enough. If the new rows will change the actual
distribution, then the stats are stale and need to be recalculated.

If you are using 11.70 with AUTO_STAT_MODE enabled, and the number of rows
inserted does not exceed the table's threshold, then the UPDATE STATISTICS
command will not do anything, so there's no harm in trying. Similarly, if
you are using my dostats utility you can add the browsing options (-b -B
<pct-chg>) to get the same behavior where AUTO_STAT_MODE is not supported or
is disabled.

Art

Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
Blog: http://informix-myview.blogspot.com/

Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Advanced DataTools, the IIUG, nor any other
organization with which I am associated either explicitly, implicitly, or by
inference. Neither do those opinions reflect those of other individuals
affiliated with any entity with which I am affiliated nor those of the
entities themselves.



On Thu, Sep 22, 2011 at 3:00 PM, Tom Lehr <tomcaml (AT) gmail (DOT) com> wrote:

Quote:
hello

we have a primary key disabled (from schema)

alter table attri add constraint primary key
(id)
constraint pk_attri_id
disabled;

after (re)enabling this primary key, does the table need update stats
run over it?

thanks
_______________________________________________
Informix-list mailing list
Informix-list (AT) iiug (DOT) org
http://www.iiug.org/mailman/listinfo/informix-list

Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.