SQL-Ledger Homepage

SQL-Ledger User Forum

Forum index page

Log in | Register

Back to the board
Thread view  Mix view  Order
Tariq(R)

16.02.2016, 05:49
 

Cash -> Receipt hanging (General)

Hi I have a problem with the Cash -> Receipt option. When I click it this results in the browser waiting for a server response which never comes and I then have to kill a process called cp.pl on the server in order to get the it working again! Even if I allow the process to wait for 5 mins I still get no response and eventually a timeout from the web server giving up.

If I turn on verbose logging on psql I can see this is the statement which does not complete (hangs). If I run this manually it also just hangs.

SELECT vc.*,
ad.address1, ad.address2, ad.city, ad.state, ad.zipcode,
ad.country, a.amount, a.paid,
a.exchangerate,
l.description AS translation
FROM customer vc
JOIN ar a ON (a.customer_id = vc.id)
JOIN acc_trans ac ON (a.id = ac.trans_id)
JOIN chart c ON (c.id = ac.chart_id)
JOIN address ad ON (ad.trans_id = vc.id)
LEFT JOIN translation l ON (l.trans_id = c.id AND l.language_code = '')
WHERE a.amount != a.paid
AND a.approved = '1'
AND a.onhold = '0'
AND NOT a.id IN (SELECT id
FROM semaphore)
ORDER BY vc.name;

I have numerous SQl-Ledger installs and this is the only one which does not complete however this install is also the largest database. I also notice the cash receipt option is slow on other installs but not yet failing to return. I wonder why it takes so long given that the cash receipt screen hardly contains anything other than a dropdown of customers?

I have tried a psql vacuum but it makes no difference. Please can someone help tell me how I can get this statement to return or to get my cash receipt option to work?

I'm using version 3.2 however the problem has been in previous versions too.

Tariq(R)

16.02.2016, 06:06

@ Tariq

Cash -> Receipt hanging [SOLVED]

fixed it mysqlf with some indexes! Now it works perfectly :)

CREATE INDEX index_customerid ON customer (id);
CREATE INDEX index_acc_transid ON acc_trans (id);
CREATE INDEX index_arid ON ar (id);

Back to the board
Thread view  Mix view  Order
963 Postings in 317 Threads, 321 registered users, 132 users online (0 registered, 132 guests)
SQL-Ledger User Forum | Admin contact
RSS-Feed
powered by my little forum