友人のために Netezza の問題を解決しようとしています。私の友人は、Netezza で非常に単純なことをしようとしています。
select *
from
test
where
ID1 = 12345
and date >= 12/1/2012 and event date <= 12/31/2012
and ID2 in
(x1, x2, ..., x150000)
このクエリは返されません。
Oracle では、次のようなことを試すことができました。
/*******************************************************************/
/*To reduce the size of the table...*/
create table t_test as
select *
from
test
where
ID1 = 12345
and date >= 12/1/2012 and event date <= 12/31/2012;
/*To make the search on ID2 faster...*/
create index i_ID2 on t_test (ID2);
select *
from
t_test
where
ID2 in
(x1, x2, ..., x150000)
/*Alternative: People say "IN" may be very inefficient at times...*/
select *
from
t_test
where
ID2 = x1
or ID2 = x2
.
.
.
or ID2 = x150000
/*******************************************************************/
ただし、Netezza にはインデックスの概念がないため、これは不可能です。
この問題を解決するにはどうすればよいですか?
よろしくお願いいたします。