databaseManager.getFoundSetCount(form.foundset)

Questions, tips and tricks and techniques for scripting in Servoy

databaseManager.getFoundSetCount(form.foundset)

Postby eKelman » Wed Sep 07, 2011 8:11 pm

Hi

I have a quick question regarding databaseManager.getFoundSetCount(form.foundset).

Is there a better way to retrieve the number of records a foundset would have?

We are running an application where the finds can take anywhere between 1-90 seconds, i know that some of the queries could be taking an unusually long time, but the data model we use is complicated and has millions and millions of records.

Running the count then nearly doubles the amount of time it requires to complete a find. I tried to utilize the search returned count, but that only returns the count for the present search and not the actual foundset result count.

I am just wondering if that is something that needs to be removed from our application to speed up performance, or if there is a way to improve this so the end users are still able to see that.
Ernest
Kelman Technologies
eKelman
 
Posts: 52
Joined: Tue May 12, 2009 9:09 pm

Re: databaseManager.getFoundSetCount(form.foundset)

Postby lwjwillemsen » Wed Sep 07, 2011 11:24 pm

Hi Ernest,

Not a quick answer from me :

The main question / discussion would be IMHO :

1) What is the importance or use for the internal business rules of a precise query count result ?
2) What is the importance or use for the end-user of a precise query count result ?

As you know Servoy returns a (fast) query result count of max. 200 (foundset.getSize()). Fast query result also with large tables (if you designed smart indexes).
Now back to 1) and 2)

In my experience for 1) I can do 99 % of my business rule validation with the query count results : 0, 1 or 1+

In my experience for 2) I could satisfy my customers info need with the foundset.getSize() result and in case of result >= 200 I would display 200+
For the curious and patient user you could make some logic and UI to fire away the databaseManager.getFoundSetCount() on the query.

We in our firm had some heated discussions on this some years ago when developing our solution framework.

Regards,
Lambert Willemsen
Vision Development BV
lwjwillemsen
 
Posts: 680
Joined: Sat Mar 14, 2009 5:39 pm
Location: The Netherlands

Re: databaseManager.getFoundSetCount(form.foundset)

Postby eKelman » Thu Sep 08, 2011 12:11 am

Hi Lambert,

Thanks for the response.

I was doing some reading online and it appears this may not be the optimal way of presenting that information to the user. We are currently debating on whether to display the actual count to the user or to remove that information from the screen. I didn't think of what you had done, and I think that would work with a button on the side to display actual count if the user wishes.

Cheers
Ernest
Kelman Technologies
eKelman
 
Posts: 52
Joined: Tue May 12, 2009 9:09 pm


Return to Methods

Who is online

Users browsing this forum: No registered users and 17 guests

cron