How to Optimize my sent message (user_outgoing) report

Hi Anton;
If there is large number of sent message in user_outgoing (user’s sent message), its taking a lot of time to display or timeout sometime. I have seen that its being used a lot of time for Billing calculation at DB, since billing rate is not used, price is 0, so can we avoid billing_getdata_by_uid and get only sent message list.
Appreciate your help.

hello
anyone can suggest please?

anyone can suggest please?

someone have good idea on this?

You can aways change that function by something like

function simplebilling_hook_billing_getdata_by_uid($uid) {
return $ret[] = array(
‘id’ => $uid,
‘smslog_id’ => $smslog_id,
‘post_datetime’ => $post_datetime,
‘rate’ => $rate,
‘credit’ => $credit,
‘count’ => $count,
‘charge’ => $charge
);
}

Hi Edilson;
Thanks for the suggestion, i have disable below function but i did not find any difference in performance. I just wanted to send sms, no need billing and rate calculation in report and send sms. (bypass billing and rate)

function simplebilling_hook_billing_getdata_by_uid($uid) {
73 $ret = array();
74 logger_print(“uid:”.$uid, 2, “simplebilling summary”);
75 $db_query = "SELECT * FROM playsms_tblBilling AS A, playsms_tblUser AS B, playsms_tblSMSOutgoing AS C " .
76 “WHERE A.smslog_id=C.smslog_id AND B.uid=C.uid AND A.status=‘1’ AND B.uid=’$uid’”;
77 $db_result = dba_query($db_query);
78 while ($db_row = dba_fetch_array($db_result)) {
79 $id = $db_row[‘id’];
80 $smslog_id = $db_row[‘smslog_id’];
81 $post_datetime = $db_row[‘post_datetime’];
82 $rate = $db_row[‘rate’];
83 $credit = $db_row[‘credit’];
84 $count = $db_row[‘count’];
85 $charge = $db_row[‘charge’];
86 $ret[] = array(‘id’ => $id, ‘smslog_id’ => $smslog_id, ‘post_datetime’ => $post_datetime, ‘rate’ => $rate, ‘credit’ => $credit, ‘count’ => $count, ‘charge’ => $charge);
87 }
88 return $ret;
89 }

So, just in case, I suggest you to purge your Outgoing table.