InterBaseを使いこなすスレ
■ このスレッドは過去ログ倉庫に格納されています
0501484
NGNGだとするとなんだろう?
外部キーとプライマリキーやUniqueのIndexが重複しているからだろうか?
(主キーのTimeStampのField以外は全て外部キーを設定してある)
以下がその外部キーの設定状態です
alter table test add constraint FK_TEST_MST1 foreign key (FIELD1) references MST0(MST0_FIELD1) on update CASCADE;
alter table test add constraint FK_TEST_MST2 foreign key (FIELD1, FIELD4) references MST1(MST1_FIELD1, MST1_FIELD2) on update CASCADE;
alter table test add constraint FK_TEST_MST3 foreign key (FIELD1, FIELD5) references MST2(MST2_FIELD1, MST2_FIELD2) on update CASCADE;
/*主キーの外部キー設定はここまで*/
/*後は各フィールド毎に必要な外部キー*/
alter table test add constraint FK_TEST_MST4 foreign key (FIELD8) references MST3(MST3_FIELD1) on update CASCADE;
alter table test add constraint FK_TEST_MST5 foreign key (FIELD1, FIELD10) references MST4(MST4_FIELD1, MST4_FIELD2) on update CASCADE;
ちなみに
select *
from TEST
where FIELD1 = '01'
and cast(FIELD6 as date) between '2001/01/01' and '2001/12/31'
and FIELD4 = '0001'
order by FIELD1, FIELD6, FIELD4;
としても、同じように遅いです
(本当はこっちの処理を行いたかったので)
現在は主キーや余分なIndexを削除して対処しています
■ このスレッドは過去ログ倉庫に格納されています