From: Pak R. <pak...@gm...> - 2018-03-12 01:02:06
|
Hi: Since some months ago, Payments.php goes very slow (some 15-20 seconds) each time a user hit submit with a new GL Analysis line into the payment. If I am not wrong code starts at line 718 until line 782 Line 720 is a query against gltrans. This query alone needs around 15-18 seconds, which points it as the main cause of the problem here. gltrans has some 5M rows, and we do not use cheque, so gltrans.chequeno = 0 for all the rows gltrans index by chequeno is setup If I modify line $ChequeNoSQL="SELECT account FROM gltrans WHERE chequeno='" . $_POST['Cheque'] ."'"; to $ChequeNoSQL="SELECT account FROM gltrans WHERE chequeno='" . $_POST['Cheque'] ."' LIMIT 1"; the issue is fixed (instant execution). Payments.php only checks twice if the query got any result, but never read the account returned, so should be no collateral damage. I can't commit to SVN as I changed laptop and could not set it up yet. Could someone please commit it? Regards, Ricard |