Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Without knowing what data you are trying to receive you could return sets of data in the code and map from the data set to the formula instead of running back to the database each time. So if you were say grabbing stock quotes or something you could grab all of the "WHERE" items and throw them into an IN clause when querying to the database. Once you have a dataset of the relevant updates you can send from the dataset instead of the database. Recalcs would grab run to the database again but through one call.</p> <p>You could extend the cells for update flags and only refresh from those. </p> <p>Pause calculations on the formula and only refresh when you have to.</p> <p>Just thinking out loud..or whatever the typing equivalent is.</p> <p>Edits: I got down to the mechanics of it in my brain and I realized I'm out of my element. Sorry. I've never created a .DLL or an Addin with VS so everything after this is purely speculation and guesswork that may or may not cause more harm than good. </p> <p>I'm thinking the UDF's execution will need to be re-routed until the execution plan is executed.</p> <p>You would need a few objects.</p> <ol> <li>ExecutionPlan - This object would manage lists of your queries. Either bulked or single transactions. You would need a method to convert the request to sql. Then pass the sql to the database in one call. </li> <li> DataCache - Which would be a recordset of all the returned data. I'd encapsulate that with a flag or something to say if it was fetched or not. </ol> <p>The formula would go something like (psuedocode)</p> <pre><code> if(dataCache.executed) formula.returnValue = dataCache.value(valueYouWantToReturn) else executePlan.add(valueYouWantToGet); formula.returnValue = "queued"; </code></pre> <p>Then you would need to force a recalculation (that would cause all 100 formulas to go to the datastore (dataCache) to get its value after the dataCache went to the database once.</p> <p>Your sql converter will be essentially building gigantic <code>IN</code> clause or a bunch of chaned <code>OR</code> through string building. So you have a clause for Ledger values that when the ExecutionPlan.Add method is called adds to the Ledger's select statement the value you want to retrieve.</p> <p>Then then when ExecutionPlan.Execute is called. It will execute the sql statement, drop it in a recordset for you to index over when your dataCache.getValue(value) is called. You would search for the "value" and send it back to the function.</p> <p>I'm explaining it to death, but I think it would work? I think...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload