angel
angel

Reputation: 41

What index i should make?

I have created a table data_test contain two fields issue_date , calling_number I have added partition for this table. PARTITION BY RANGE ("ISSUE_DATE") flow daily. and created a local index on calling_number. Which index should I make in order to use the following query :

SELECT * FROM data_test WHERE issue_date >'01-sep-2014' 
AND calling_number = '902000001'. 

Now it is selecting too slow.

Upvotes: 0

Views: 83

Answers (1)

Rusty
Rusty

Reputation: 2138

If you do not need to maintain uniqueness and create index only for performance reasons then create non unique local index by column calling_number. Partition key column not need to be indexed as local index will be partitioned by this column anyway and when you specify condition by issue_date only appropriate index partitions will be scanned.

 create index data_test_idx on data_test(calling_number) local;

Upvotes: 1

Related Questions