Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Is ExecuteSQL the best option for this design need?

Featured Replies

Hello.

 

I am trying to determine if using an ExecuteSQL function to return results in a portal will be faster than using a Filter Portal option. Here's the need:

 

I have a Report table that is related another table Called Expenses. The expense file has around 10,000+ records and will grow monthly. My design is to display only some of those expenses based on the criteria included in the different reports from the Report table. For example, I may want to drill down on a certain date range, expense values, category of expense, etc. What is the most efficient way to display these results? Since there are many possible variables, it doesn't seem a straight relationship will be easy to do. So I thought of portal filtering, but this seems to have  performance hit. So then I thought I could use Execute SQL to gather the ids and have the relationship based on that info.

 

Thoughts?

 

Thanks,

 

Stephen

That would work.  You may also be better off doing this in a list view and using regular finds instead of showing the expenses through a portal.

SQL is great as LNG as you do not return large record sets or use it in an unstored calc in list view

  • Author

Ok, thanks for the feedback everyone. If I don't use SQL and yet have many options that make my relationship more challenging, any options for me. Using list view isn't an option in my scenario.

A filtered portal with 10k records is going to hurt over the WAN. In addition, Portal Filtering is implicit coding which could cause trouble for future development when either you or someone else comes into the file and tries to figure out what is going on in the portal.

 

Using ExecuteSQL would serve you well here. Gather the IDs using SQL and set a global field to trigger the relationship. Just make sure to stay clear of unstored calculations in your SQL statement as these will cause performance degradation.

 

I hope this helps

Every technique has advantages and disadvantages.

 

If you're using certain comparison operators for ExecuteSQL() you're going to see major performance issues. If you're using >,<, %, or LIKE, forget it.

 

Relationships are usually the fastest in those situations, as long as you're not targeting unstored calculation fields. If you are, then List View and finds are likely the fastest.

 

With that many records, performance will be an issue, especially on the first pass.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.