database - Looking for data in a table through colums with categories/state values -
say have fruits that having high number of reads inserts though not update nor delete.
we have 2 columns stores values have small number of options. lets categories[banana, apple, orange or pear] , status[finished, ongoing, spoiled, destroyed or ok].
finally, have column last name of owner.
notes:
going searchs category , other status.
in cases, lastname used search.
perform exact match on categories/status start in last name.
ex of common queries:
select * fruit_table category='banana' , last_name 'cool%' select * fruit_table status='spoiled' , last_name 'co%' select * fruit_table category='banana' , last_name 'smith%'
how can prepare have low response time?
will index help(taking account values in column not disperse @ all)?
might bitmap index here?
what partitioning?
finally, apologies title, did not know how formulate properly.
- bitmap indexes immensely items have limited number of available choices.
- a standard b-tree index (or non-clustered in sql server) work last_name column.
2 first, easy , see how things work.
it bad practice prematurely optimize. however, adding indices quick way increase speed without effort. more information on indices in oracle, read this question.