oracle - SQL index with in clause -
our application has gone slow in 1 of env. alter have done changed sql. before release, sql this
select employeeid employee dept='cs' , record_state='active' , employeetypeid ='1'
after release sql
select employeeid employee dept='cs' , record_state='active' , employeetypeid in ('1','2')
the index on table employee_state_id_index (dept,record_state,employeetypeid ) index has not been changed. index not help new sql? new sql scan whole table? have no thought how indexes work in clause. appreciate help , comments
the explain plan query is
| id | operation | name | rows | bytes | cost (%cpu)| | 0 | delete statement | | 1 | 57 | 4 (0)| | 1 | delete | employee | | | | |* 2 | index range scan| employee_state_id_index | 1 | 57 | 4 (0)| -------------------------------------------------------------------------------- predicate info (identified operation id): plan_table_output 2 - access("c"."dept"='cs' , "c"."record_state"='active') filter("c"."employeetypeid"='1' or "c"."employeetypeid"='2')
the solution problem faced, reindexing table. table had 10 1000000 records , cleaned info in table (when realized had duplicate records) , reduced half of amount of records had. thought give seek reindexing, since anyway needed it. , helped :)
sql oracle indexing oracle10g in-clause
No comments:
Post a Comment