How to avoid deadlocks.. advice needed also insight, illumination and a bit of hallucination...

2011-04-20 Thread Andrés Tello
I'm running into some deadlocks issues. I have this structure accounting |---movements To know the balance of the account, I usualy do a sum(movements.amount) where accounting.id=someid The issue is that the sum is starting to run very slow due hardware constraints, and I can't trow more

Re: How to avoid deadlocks.. advice needed also insight, illumination and a bit of hallucination...

2011-04-20 Thread Johan De Meersman
The smoothest way to avoid deadlocks, is to ensure that all your sessions lock their tables in exactly the same order. From your explanation, that might not be as easy as one would expect, though. If you can't create triggers, is it acceptable to have delayed updates on the totals? Your idea