# Best programming practices / clarification

**URL:** <https://forum.servoy.com/t/best-programming-practices-clarification/4120>\
**Category:** Classic Servoy\
**Created:** [April 28, 2005, 4:42pm UTC](https://forum.servoy.com/t/best-programming-practices-clarification/4120 "2005-04-28T16:42:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ebrandt](https://avatars.discourse-cdn.com/v4/letter/e/96bed5/32.png) [@ebrandt](https://forum.servoy.com/u/ebrandt)\
**Post date:** [April 28, 2005, 4:42pm UTC](https://forum.servoy.com/t/best-programming-practices-clarification/4120/1 "2005-04-28T16:42:38Z")

</div>

I have a few questions regarding searchs and queries.

Throughout my solution I have work queues set up so when a department selects a button, a “Find and Search” is done (through serveral thousand records) displaying the records that meet certian critera.

So far everything works fine, As I apporach the the reporting module, I understand the need and power using SQL queries and displaying the results in HTML for complex reports involving serveral tables and calculations.

I also have serveral reports that are basically listings sorted and summarized. Which I could use the ‘find and search technique’ and display in report layout (Similar to Filemaker).

My question is this ; I was under the impression that when using the “find & Search” , Servoy is translating the requesting into a SQL statement (Query)

What might determine to need for direct SQL query, V.S. and “search & Find” method. say for a search on one table with a few thousand records.

I am trying to best understand how performance is effected, and when I can build a simple listing style report, over a more complex HTML formated report.

Thanks for any insight!

---

<div class="post-metadata">

**Author:** ![bcusick](https://avatars.discourse-cdn.com/v4/letter/b/ed8c4c/32.png) [@bcusick](https://forum.servoy.com/u/bcusick)\
**Post date:** [April 28, 2005, 6:14pm UTC](https://forum.servoy.com/t/best-programming-practices-clarification/4120/2 "2005-04-28T18:14:12Z")

</div>

Hi,

Servoy uses SQL queries for EVERYTHING. Period. When you use this code:

(Assumes the your form is based on “customers” table)

```auto
controller.find()
cust_type = 'Vendor'
controller.search()

```

The SQL that Servoy is generating looks something like this:

```auto
SELECT customerID FROM customers WHERE cust_type='Vendor'

```

So whether you issue your own SQL Query or you use the standard “find” command - it’s still using SQL behind the scenes.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![ebrandt](https://avatars.discourse-cdn.com/v4/letter/e/96bed5/32.png) [@ebrandt](https://forum.servoy.com/u/ebrandt)\
**Post date:** [April 28, 2005, 7:15pm UTC](https://forum.servoy.com/t/best-programming-practices-clarification/4120/3 "2005-04-28T19:15:19Z")

</div>

Understood regarding the select statements.

SO there is no performance issues relating to the translation performed at the logic level, opposed to a direct query on the backend.

I was not sure when standard list / summary reports start to suffer performace (speed) issues and SQL/HTML reporting would be a more appropriate design.

As with filemaker a complex report based on daisy chained calculations could take several minutes to run.

When should I use list / summary reports,

when should I use SQL /HTML style reports, is there a basic rule of thumb?

---

<div class="post-metadata">

**Author:** ![Riccardino](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@Riccardino](https://forum.servoy.com/u/Riccardino)\
**Post date:** [April 28, 2005, 8:25pm UTC](https://forum.servoy.com/t/best-programming-practices-clarification/4120/4 "2005-04-28T20:25:00Z")

</div>

> ebrandt:  
> When should I use list / summary reports,
> 
> when should I use SQL /HTML style reports, is there a basic rule of thumb?

If you have complex reports, with calculations and summaries, using SQL/HTML can give you a tremendous boost, especially if you have to scroll the report.
