• Thanks a lot for your help

    Replacement every thing over. Now if i run the below query its querying for long time due to huge datas in DB(PostgreSQL). if i run same query outside i am getting test data's quickly. Now tell me how to get quick datas.

    Since here we are splitting,joining, comparing,with the the timestamp we have to give the result.

    So it takes time to pull the datas.............

    DROP TABLE IF EXISTS OwnerMessageList1;

    CREATE TEMPORARY TABLE OwnerMessageList1 (

    id serial,

    name varchar(100)

    );

    INSERT INTO OwnerMessageList1

    (name)

    select unnest(string_to_array(replace(replace('$filter', 'itime >= ', ''),'itime <= ',''),'and'));

    select distinct split_part(split_part(cp.msg, 'src=',2),',',1),split_part(split_part(cp.msg, 'user=''',2),',',1) as user ,am.itime,am.dtime,am.url from "FGT60B3908669009-wlog-1380091698" am join "SYSLOG-C0A80A41-glog-1380347892" cp on cast(am.src as character varying)=cast((split_part(split_part(cp.msg, 'src=',2),',',1) ) as character varying) where (cast(am.itime as varchar)<=(select name from OwnerMessageList1 where id=1) and cast(am.itime as varchar)>=(select name from OwnerMessageList1 where id=2));

    Thanks,

    Shobana:blink: