sql - to_char in date yyyymmdd takes long time in execution in oracle -
this query takes long time around 4 hours due huge data
create or replace force view vv12 ( name, type, sdate ) as
( select name, type ,sdate (select to_char(datee,'yyyymmdd') sdate, dateesdate1 , name, type , ... table ,table b
where sdate between '20170617' , '20170620'
and a.id=b.id and....);
while below query takes 4 sec return data
create or replace force view vv12 ( name, type, sdate ) as
select name ,type, sdate (select to_char(a.datee,'yyyymmdd') sdate, a.datee sdate1, name, type ,... table ,table b
where sdate1 between '17-jun-2017' , '20-jun-2017'
and a.id=b.id and...)
where 1 below throws error :
invalid user.table.column, table.column, or column specification
select name ,type, sdate (select to_char(a.datee,'yyyymmdd') sdate, to_date (a.datee,'yyyyddmm') sdate1, name, type ,... table ,table b
where between to_date ('20170617','yyyymmdd') , to_date ('20170620', 'yyyymmdd')
and a.id=b.id and...)
i have call sdate (which in char , takes long time) in view , having format @ asp.net form input from_date , to_date 'yyyymmdd'
kindly guide me how can extract data view can convert to_date feature yymmdd in select , can execute query fast other using to_char
Comments
Post a Comment