Given a table with 100 list partitions. Each partition size of 10GB, 30 million lines.
create table mydata ( city varchar2(100) not null, purchase_id number not null, reference_id number not null, aaa_id number not null, bbb_id number not null, some_data1 varchar2(100) not null, some_data2 varchar2(100) not null, some_data3 varchar2(100) not null, ) partition by list(city) (partition newyork values ('NEWYORK'), partition paris values ('PARIS'), ... 98 more partitions );
It is necessary to provide an opportunity for the application to read the lines with a filter in one of the fields. Only 3 partitions are needed. An hour later, this opportunity can be closed.
Request:
select * from mydata where city ='NEWYORK' and aaa_id=12345;
In the request, the value of the city condition changes every hour, as well as the FIELD of the second condition. That is seichas:
where city ='NEWYORK' and aaa_id=12345
in an hour:
where city ='NEWYORK' and aaa_id=12345;
, In 2 hours:
where city ='NEWYORK' and aaa_id=12345;
etc..
The number of requests is about 1 million per hour. The number of possible fields for the filter is 30.
Building a local index on the entire table takes a lot of time. Keeping indexes on every possible field is too much space and slows down the insertion very much.
Question
Is it possible to build a local index only for partitions?
Oracle 12.1 Enterprise Edition.