nenu_devudni Posted September 1, 2016 Report Posted September 1, 2016 In my query i am checking if my date field is equal to sysdate .. and using trunc on both ends .. and my date field has a index on it .. and by using trunc .. aa index dobutundi .. and its taking lot of time to execute .. how do i keep my index from not blowing using trunc ... seppandi vay Quote
nenu_devudni Posted September 1, 2016 Author Report Posted September 1, 2016 @loveindia thatha ravali .. nanu ee gothi lo nundi bayatiki teyali Quote
150bryant Posted September 1, 2016 Report Posted September 1, 2016 indexed-date field ni inko additional column/field ga pull/populate cheyi... aa field ki edoka alias peru ivu.. do operations on that alias field in short: you are creating a substitution field..without messing wit indexing Quote
SwamyRaRa Posted September 1, 2016 Report Posted September 1, 2016 Disable index and truncate table then insert after insert create index Quote
nenu_devudni Posted September 1, 2016 Author Report Posted September 1, 2016 1 minute ago, SwamyRaRa said: Disable index and truncate table then insert after insert create index adi production table thatha ..ala cheste bagodu emo kada Quote
nenu_devudni Posted September 1, 2016 Author Report Posted September 1, 2016 16 minutes ago, 150bryant said: indexed-date field ni inko additional column/field ga pull/populate cheyi... aa field ki edoka alias peru ivu.. do operations on that alias field in short: you are creating a substitution field..without messing wit indexing koncham confeesing ga undi vuncle ... Quote
nenu_devudni Posted September 1, 2016 Author Report Posted September 1, 2016 23 minutes ago, 150bryant said: indexed-date field ni inko additional column/field ga pull/populate cheyi... aa field ki edoka alias peru ivu.. do operations on that alias field in short: you are creating a substitution field..without messing wit indexing select trunc(my_date_field) as req_date, (select count(*) from tablename where blah_blah = 'O' and bluh_bluh= 'RMTE' and bleh_bleh = 'C11' and req_date = trunc(sysdate) ) from tablename b did u mean something like this ? Quote
SwamyRaRa Posted September 1, 2016 Report Posted September 1, 2016 1 hour ago, nenu_devudni said: adi production table thatha ..ala cheste bagodu emo kada Oh prod.. Ok Quote
nenu_devudni Posted September 1, 2016 Author Report Posted September 1, 2016 sepanndi me mokal mands uuu .. Quote
Tesla Posted September 1, 2016 Report Posted September 1, 2016 select * from tab1 where load_dt > trunc(sysdate) or select * from tab1 where load_dt between trunc(sysdate) and trun(sysdate)+1 Quote
nenu_devudni Posted September 1, 2016 Author Report Posted September 1, 2016 8 minutes ago, Tesla said: select * from tab1 where load_dt > trunc(sysdate) or select * from tab1 where load_dt between trunc(sysdate) and trun(sysdate)+1 tanks tesla vuncle .. this worked Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.