Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2009
    Posts
    2

    Unanswered: Query Takes long time to bring output

    this below query takes short time to bring the output .

    EXPLAIN ANALYZE select sum(count) from ( select count(accseqno) from acc_axs_log a where exists (SELECT callid from acc_axs_log b where ( b.stime between '10:0:00' and '12:59:59' and b.sdate between '22/12/2009' and '26/12/2009' and b.callid = a.callid ) group by(callid) having count( distinct accseqno) = 1 ) and acctype ='SBA' and ( stime between '10:0:00' and '12:59:59' and sdate between '22/12/2009' and '26/12/2009' ) group by callid ) as TotalCount

    The attachment filename is "short_query_plan" .
    The below query takes long times to bring the output .

    EXPLAIN ANALYZE select sum(count) from ( select count(accseqno) from acc_axs_log a where exists (SELECT callid from acc_axs_log b where ( b.stime between '10:0:00' and '12:59:59' and b.sdate between '23/12/2009' and '26/12/2009' and b.callid = a.callid ) group by(callid) having count( distinct accseqno) = 1 ) and acctype ='SBA' and ( stime between '10:0:00' and '12:59:59' and sdate between '23/12/2009' and '26/12/2009' ) group by callid ) as TotalCount

    The attachment filename is "long_query_plan" .

    The different of the both the query is .
    date range is different .

    I don't know why the second query takes long time then first query .
    Attached Files Attached Files

  2. #2
    Join Date
    Dec 2009
    Posts
    2
    Quote Originally Posted by vetrivel View Post
    this below query takes short time to bring the output .

    EXPLAIN ANALYZE select sum(count) from ( select count(accseqno) from acc_axs_log a where exists (SELECT callid from acc_axs_log b where ( b.stime between '10:0:00' and '12:59:59' and b.sdate between '22/12/2009' and '26/12/2009' and b.callid = a.callid ) group by(callid) having count( distinct accseqno) = 1 ) and acctype ='SBA' and ( stime between '10:0:00' and '12:59:59' and sdate between '22/12/2009' and '26/12/2009' ) group by callid ) as TotalCount

    The attachment filename is "short_query_plan" .
    The below query takes long times to bring the output .

    EXPLAIN ANALYZE select sum(count) from ( select count(accseqno) from acc_axs_log a where exists (SELECT callid from acc_axs_log b where ( b.stime between '10:0:00' and '12:59:59' and b.sdate between '23/12/2009' and '26/12/2009' and b.callid = a.callid ) group by(callid) having count( distinct accseqno) = 1 ) and acctype ='SBA' and ( stime between '10:0:00' and '12:59:59' and sdate between '23/12/2009' and '26/12/2009' ) group by callid ) as TotalCount

    The attachment filename is "long_query_plan" .

    The different of the both the query is .
    date range is different .

    I don't know why the second query takes long time then first query .

    I have posted , the above problem , finally we found a solution .
    Solution:-
    * I run vaccum comma to perticular table .
    * Then I run the query , it works successfully .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •