Ordering text

Bob Sneidar bobsneidar at iotecdigital.com
Wed Apr 1 15:46:12 EDT 2020

So this is a database schema issue. Typically what you will want to do with things like balances is to store the balance in a column as each value in the equation changes. You are asking your SQL server to do all the calculations for all your records all at once. If SLQ only has to calculate when insert/update is performed, you wouldn’t notice. Better yet, do the calculations in Livecode and store the result in the database column. WAAAAY quicker.

Bob S

On Apr 1, 2020, at 12:13 PM, Terence Heaford via use-livecode <use-livecode at lists.runrev.com<mailto:use-livecode at lists.runrev.com>> wrote:

This actually works but is very slow (> 800ms)

put merge("SELECT *,SUM (amount) OVER (ORDER BY recID) AS balance FROM myAccountName") into tSQL

I have settled on my earlier suggestion

Earlier suggestion results in 20ms performance.

More information about the use-livecode mailing list