Questions on Indexing and Calculations

Some general questions on servoy.

Does servoy attempt to do any auto-indexing in the SQL backend based on Find activity, etc.? Or is that completely up to the developer?

When are “Calculated” fields in Servoy evaluated. Since they seem to be “real” fields with a Calculated mask, just curious as to when the Calculations get applied. For example if I import data through SQL*Loader, presumably Servoy knows nothing about that data until it’s viewed through Servoy at some point.

Just trying to understand the beast a bit better.

Thanks,
Lee Snover

Hi Lee,

Servoy does not do anything with indicies on the backend - that’s up to the developer.

Calculations function like “virtual” columns - and are evaluated when necessary. It depends on stored versus un-stored calculations. Un-stored calcs are updated when needed (i.e. displayed or referenced by another calculation, etc). STORED calculations are also only updated when necessary (i.e. displayed or used on a report, etc). When you do a load into the database outside of Servoy, the calculations are not “refreshed” until that particular record(s) is “touched” in the application (Servoy calcs only “live” in the solution, not on the database backend).

Hope this helps clarify.

bcusick:
Hi Lee,

Servoy does not do anything with indicies on the backend - that’s up to the developer.

Calculations function like “virtual” columns - and are evaluated when necessary. It depends on stored versus un-stored calculations. Un-stored calcs are updated when needed (i.e. displayed or referenced by another calculation, etc). STORED calculations are also only updated when necessary (i.e. displayed or used on a report, etc). When you do a load into the database outside of Servoy, the calculations are not “refreshed” until that particular record(s) is “touched” in the application (Servoy calcs only “live” in the solution, not on the database backend).

Hope this helps clarify.

Bob:

I did not see a “Stored” vs. “Unstored” option in the Calculation definition window. Am I missing something obvious? If they only evaluate when referenced, what’s the difference?

So, if I bring data in through another source, and I have say a “summary” field in Servoy, will the summary be accurate? Or will I have to step through the records in some process to get them up to date? Is it safe/recommended to build Insert/Update triggers into the backend that essentially reflect the same calculations to insure that the data is always consistent? I don’t want to over engineer the thing, but I want to block holes in the process at the same time.

Regards,
Lee Snover

Lee,

To make a stored calculation, create a column of the same type with the same name as the calculation.

airmark:
Lee,

To make a stored calculation, create a column of the same type with the same name as the calculation.

I thought that was the only way to do it? When I go to the Calculation tab, all the existing field names show up, so I thought that I had to use one. So, I can make a name that isn’t a real field? And then I would assume it’s only a Servory entity.

Thanks,
Lee

Correct.

leesnover:

airmark:
Lee,

To make a stored calculation, create a column of the same type with the same name as the calculation.

I thought that was the only way to do it? When I go to the Calculation tab, all the existing field names show up, so I thought that I had to use one. So, I can make a name that isn’t a real field? And then I would assume it’s only a Servory entity.

Thanks,
Lee

OK,

I made my Calculation a stored calc, it’s just a substring of one of the fields in the same file. I then imported approximately 300,000 records, which went relatively quick. However, now when I do a “Find” on my Stored Calculated field, I only get 145 records. There should be about 90,000 with the value I’m searching for, so they obviously have not been updated. So, how do I force all the calculated values to get set on Imports and in normal operation?

Thanks,
Lee Snover

airmark:
Correct.

Can you “Find” on unstored calcs?

You cannot find or sort on unstored calcs.

airmark:
You cannot find or sort on unstored calcs.

That’s what my test confirmed. ;-)

How do I get all the Stored Calcs to value and update after an Import?

Shouldn’t this be an option when Importing? I did “import” the calculated fields from my Filemaker Export, but they seem to be blank unless I “look” at them in servoy, and even that does not seem to always update them.

Thanks,
Lee