database - How to do search on a table while table have millions of record -


i have run below query in sybase database , return millions of record. when run took lot of time , many of times timeout.

select * table1 t1 t1.oneid in ( select t2.oneid  table2 t2 t2.twoid in  (     select distinct t3.twoid table3 t3   ) ) @ isolation 0 

so can 1 suggest me way can bulk operation getting data?

try :

select     t1.* (     select          distinct t3.twoid      table3 t3  ) tmp inner join table2 t2     on t2.twoid = tmp.twoid inner join table1 t1     on t1.oneid = t2.oneid 

it should faster if have indexes on t2.twoid , t1.oneid


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -