databaseManager.setCreateEmptyFormFoundsets() useage

I was recently burned by not thinking to add a call to databaseManager.setCreateEmptyFormFoundsets() to the onSolutionOpen method of one of my solution. That “SELECT pk FROM table” query really starts to take it’s toll when you’ve got a few million records in your table. :oops:

I know you can set up your forms individually to not have this behaviour, but in my experience when first visiting a form we want one of two things: empty foundset or the result of a search, leaving very little room left for wanting to show up on a form and just have it load all the records for me as a default behaviour.

So I got curious what the rest of the community was doing and if I just wasn’t thinking of all those times when you do actually want ALL the records.

If you don’t use databaseManager.setCreateEmptyFormFoundsets(), enlighten me and share your story; inquiring minds want to know.

Do you use databaseManager.setCreateEmptyFormFoundsets() in your onSolutionOpen method?
  • Always
  • Usually
  • Sometimes
  • Never
  • I don’t know what you’re talking about
0 voters

I use it always, because, every form (with lot of tabs) loads MUCH quicker, even with a small amount of records.
So I dont understand what you say about tables with million of records, Servoy only loads/queries the first 200? right?

Harjo:
Servoy only loads/queries the first 200? right?

Yes and no…Servoy only loads the first 200, but if you look at the performance log the query it executes is essentially “select pk from tablename order by pk”, so that if you were to scroll down to the bottom of those 200, you’d get the next 200, etc etc, until all are loaded.