sql - Creating non clustered Index for multi table joins -


i have written query joining multiple tables , multiple column condition. have large amount of data need create index on these columns. query should use index better performance. let me know how create below scenario ?

select    a.name,   b.sal,   c.date1        inner join b on a.id = b.id    inner join c on b.id1 = c.id1    a.status1 = '0'    , a.totalamt <> 0    , a.flag = 'n'    , b.sal > 100    , c.date1 not in('2008-08-08', '2009-09-09') 

i tying same thing @ozren has written.but verify condition have written .

primary key

  table a=id   table b=id1   table c=id1   verify uncessary condition    i)  when sal>100 totalamt >0 (is so?)   ii) a.status1 , a.flag ?(like when flag='n' status always='0'        can put such validation while insert , avoid condition. 

non ci

table (status1, totalamt, flag) table b (sal) table c (date1) 
  1. analyze proc check amonth thee columns use in condition.
  2. if example flag='n' use can use filtered index on column
  3. also ensure proper data type flag char(1) , not varchar etc.

Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -