I have a table with about 10mln rows in it with a primary key and an index defined on it:
create table test.test_table(
date_info date not null,
string_data varchar(64) not null,
data bigint
primary key(date_info, string_data));
create index test_table_idx
on test.test_table(string_data);
I have a query that makes the use of the test_table_idx
:
select distinct date_info from test.test_table where string_data = 'some_val';
The issue is that first time around it could take up to 20 seconds to run the query and < 2 seconds on any subsequent runs.
Is there a way to pull load the entire index into memory rather then have DB load information on first access?