Foundset - controlling which columns to be loaded

Hi

To be sure I do not overlook it, is there a way to control what columns Servoy loads after having loaded the PKs for the given foundset?
I would like to be able to control which columns to be loaded by the foundset (after it has loaded the PK data), or even better, to be able to control which columns, calcs or aggregates to avoid loading. Reason for this is, some forms don’t show any calcs, but they are nevertheless calculated and consume quite a lot of time.
Looking at the JSFoundSet object, there is an omitRecord, but not an omitColumn method, which could help.
Having the possibility to control that a form only loads the shown columns would also help to speed up the response time in certain circumstances.

Best regards
Robert

Hi Robert,

The short answer is No.
When you load a foundset record every column is loaded and all calculations and aggregates are triggered.
If you really need to have control over this you need to use in-memory datasources that you load and manage yourself.

Hope this answers your question.

Hi Robert

Thanks for confirmation. I did not find a lot for in-memory datasources, but on the thread below you give a code example where you write in the last line

// now you can use the foundset as a normal foundset

viewtopic.php?p=110574

Does that mean data broadcasting for example is retained and working with in-memory datasources? Does it really behave like a ordinary foundset after it is set up?
I could not find much information about in-memory datasources in the Servoy documentation. I did not know we have a hsqldb on the Servoy Application Server.

Regards

calculations are not all triggered
only when ask for, or only when we save data to the database (then stored calcs are recalculated just before the save, so they are in the right state)

aggregates are triggered also only if you ask for it as far as i know, but if you ask for 1 we try to query them all at once so we don’t need to do a query per aggregate if you keep asking for others.

jcompagner:
calculations are not all triggered
only when ask for, or only when we save data to the database (then stored calcs are recalculated just before the save, so they are in the right state)

I stand corrected.

jcompagner:
aggregates are triggered also only if you ask for it as far as i know, but if you ask for 1 we try to query them all at once so we don’t need to do a query per aggregate if you keep asking for others.

I have seen aggregate queries been triggered while not being used. I guess I can do a quick test with the latest version.

Hi Robert,

huber:
Does that mean data broadcasting for example is retained and working with in-memory datasources? Does it really behave like a ordinary foundset after it is set up?
I could not find much information about in-memory datasources in the Servoy documentation. I did not know we have a hsqldb on the Servoy Application Server.

In-memory datasources have no concept of a table to manage like your regular foundset does, you load it with a dataset that could have been filled by code or by a query.
So if you want to perform CRUD actions on such a foundset you can using the foundset methods but it will all be inside the in-memory datasource. Writing it back to any table(s) that might have been used it up to you.
In-memory datasources are also not visible between client sessions, each have their own version of it. It’s essentially a temporary table and therefor there is nothing to data broadcast to other sessions.

Hope this helps.

Thanks for your details, Robert. And yes, the picture get’s clearer.