Re: Unique index ??
Posted in 2005
Topics: General Discussion
Dirk Moolman said: > I am having an argument with one of our developers. He wants me to > create the following (unique) index on a new table. This just sounds > ridiculous to me. > > Any comments / suggestions ? A swift "bitch slap", I think. > create unique index "stanley".iu_dao on "stanley".done_and_out > > (dao_scheme_chk,dao_category_chk,dao_operator_chk,dao_status_chk, > dao_dt_from_chk,dao_dt_to_chk,dao_ta_code_chk,dao_rule_chk, > > dao_iteration_chk,dao_rej_code_chk,dao_batch_type_chk,dao_dr_type_chk, > dao_units_chk,dao_clm_amt_chk,dao_tar_amt_chk,dao_ben_amt_chk); > > > > Here is the table schema: > > create table "stanley".done_and_out > ( > dao_pk serial not null , > dao_scheme_chk char(4) not null , > dao_category_chk smallint not null , > dao_operator_chk char(8) not null , > dao_status_chk char(1) not null , > dao_dt_from_chk date not null , > dao_dt_to_chk date not null , > dao_ta_code_chk char(7), > dao_rule_chk char(4), > dao_iteration_chk smallint, > dao_rej_code_chk smallint, > dao_batch_type_chk smallint, > dao_dr_type_chk char(3), > dao_units_chk decimal(10,2), > dao_clm_amt_chk char(20), > dao_tar_amt_chk decimal(10,2), > dao_ben_amt_chk char(20), > dao_operator_ass char(8) not null , > dao_status_ass char(1), > dao_rej_code_ass smallint, > dao_tar_amt_ass decimal(10,2), > dao_ben_amt_ass decimal(10,2), > dao_mem_amt_ass char(20) > ) > > sending to informix-list > -- Bye now, Obnoxio "C'est pas parce qu'on n'a rien ' dire qu'il faut fermer sa gueule" - Coluche "I'm trying to see things your way, but I can't get my head up my ass" - JCH "Ogni uomo mi guarda come se fossi una testa di cazzo" - Marco You are better at sex than anyone. Now all you need is a partner. I went to the airport to check in and they asked what I did because I looked like a terrorist. I said I was a comedian. They said, "Say something funny then." I told them I had just graduated from flying school. -- Ahmed Ahmed sending to informix-list
Obnoxio The Chav wrote: > Dirk Moolman said: > >>I am having an argument with one of our developers. He wants me to >>create the following (unique) index on a new table. This just sounds >>ridiculous to me. >> >>Any comments / suggestions ? > > > A swift "bitch slap", I think. > > >>create unique index "stanley".iu_dao on "stanley".done_and_out >> >> (dao_scheme_chk,dao_category_chk,dao_operator_chk,dao_status_chk, >> dao_dt_from_chk,dao_dt_to_chk,dao_ta_code_chk,dao_rule_chk, >> >>dao_iteration_chk,dao_rej_code_chk,dao_batch_type_chk,dao_dr_type_chk, >> dao_units_chk,dao_clm_amt_chk,dao_tar_amt_chk,dao_ben_amt_chk); >> >> >> >>Here is the table schema: >> >>create table "stanley".done_and_out >> ( >> dao_pk serial not null , >> dao_scheme_chk char(4) not null , >> dao_category_chk smallint not null , >> dao_operator_chk char(8) not null , >> dao_status_chk char(1) not null , >> dao_dt_from_chk date not null , >> dao_dt_to_chk date not null , >> dao_ta_code_chk char(7), >> dao_rule_chk char(4), >> dao_iteration_chk smallint, >> dao_rej_code_chk smallint, >> dao_batch_type_chk smallint, >> dao_dr_type_chk char(3), >> dao_units_chk decimal(10,2), >> dao_clm_amt_chk char(20), >> dao_tar_amt_chk decimal(10,2), >> dao_ben_amt_chk char(20), >> dao_operator_ass char(8) not null , >> dao_status_ass char(1), >> dao_rej_code_ass smallint, >> dao_tar_amt_ass decimal(10,2), >> dao_ben_amt_ass decimal(10,2), >> dao_mem_amt_ass char(20) >>) >> >>sending to informix-list >> > > > The question he needs to answer is "Why do you need this unique index?" :D If this is to ensure uniqueness, then what a wierd db design. If this is to get "performance", then there is no understanding of db design. If this is to get a "swift bitch slap", then cool :D