# controller.find vs foundset.find

**URL:** <https://forum.servoy.com/t/controller-find-vs-foundset-find/10470>\
**Category:** Classic Servoy\
**Created:** [March 25, 2009, 3:11pm UTC](https://forum.servoy.com/t/controller-find-vs-foundset-find/10470 "2009-03-25T15:11:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sjk](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@sjk](https://forum.servoy.com/u/sjk)\
**Post date:** [March 25, 2009, 3:11pm UTC](https://forum.servoy.com/t/controller-find-vs-foundset-find/10470/1 "2009-03-25T15:11:27Z")

</div>

We get poor search peformance when a form is based on Oracle views. Some of the views use 50 columns. My question is if I were to use controller.loadRecords(sql) to load the form, how will the find work ? Currently we use a global controller.find. Is that the reason the search is slow ? Should I be using foundset.find instead? . What is the difference ? Will the related foundsets work correctly?

---

<div class="post-metadata">

**Author:** ![Hans\_Nieuwenhuis](https://avatars.discourse-cdn.com/v4/letter/h/87869e/32.png) [@Hans\_Nieuwenhuis](https://forum.servoy.com/u/Hans_Nieuwenhuis)\
**Post date:** [March 25, 2009, 5:50pm UTC](https://forum.servoy.com/t/controller-find-vs-foundset-find/10470/2 "2009-03-25T17:50:12Z")

</div>

Hi,

Are you sure hat the the perfomance issue only exists in Servoy ?

I would suggest to do the same query in sqlplus and look at the performance there.

If it is poor performance there also, look at the query’s execution plan.

Also look at the primary key defined for this view in servoy. Is it a unique key ?

Also realize that if records are added to the tables that make up the view, Servoy does not see those until you restart  
or do a “refresh from database” on the view.

Regards,

Hans

---

<div class="post-metadata">

**Author:** ![sjk](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@sjk](https://forum.servoy.com/u/sjk)\
**Post date:** [March 25, 2009, 6:22pm UTC](https://forum.servoy.com/t/controller-find-vs-foundset-find/10470/3 "2009-03-25T18:22:18Z")

</div>

The view uses primary keys as the rowident. We’ve found that Oracle views with outer joins are inherently slow for large datasets. Thats why I am wondering if using the view definition’s sql in controller.loadRecords(sql) will make any difference in performance.

---

<div class="post-metadata">

**Author:** ![rgansevles](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@rgansevles](https://forum.servoy.com/u/rgansevles)\
**Post date:** [March 30, 2009, 8:25am UTC](https://forum.servoy.com/t/controller-find-vs-foundset-find/10470/4 "2009-03-30T08:25:52Z")

</div>

You can use the Performance Data section on the Server Admin page to see which queries are run and the time they took.

Rob
