Hi Experts,
I am using a dql query on audittrail table, to get the username,last webtop access date(custom application),Total numbers of days in webtop(custom application).
following are the queries to get the required out put.we have three environments(development,QA and production),in dev environment it's working fine.
but in QA & Production ,because huge amount of data it's taking lot time due to that which session is time out and it's not returing data.
Please advice how to reduce the execution time.
main query
select user_name,'$1$','$2$' from dm_user where r_is_group = FALSE and user_state = 0 and user_name not like 'dm%' order by user_name
sub queries
select time_stamp from dm_audittrail where user_name ='%s' and event_name = 'dm_connect' order by time_stamp desc enable(RETURN_TOP 1)
select distinct DATETOSTRING(time_stamp,'mm/dd/yyyy') from dm_audittrail where user_name ='%s' and event_name in ('dm_connect') and DATEDIFF(day, time_stamp, DATE(TODAY))<=180
your help is highly appriciated
thanks
Hari