cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Impactful Individual
Impactful Individual

Those of you Using OnPrem SQL - Help with speed

All of my apps rely heavily on sql reading and writing and speed for the user is very slow if using offline capabilities is very slow when patching through a gateway.

I'm writing this to give some quick tips on how to handle this and improve (massively) the speed of your apps.

Reading Data:
If you have to perform filters on big tables this can be slow, one of my apps was taking around a minute to load data into collections). Not ideal.
In order to improve this I have created a list within SharePoint with the same columns, made a flow to collect sql rows overnight into this list with any filters that don't need user input. I can then use this list within powerapps which improves speed as it hasn't got to go through the gateway and get restricted by system resources on the onprem server and also the list is smaller as I've already performed some of the filter I need.

Writing
I was getting patch times of over 2 minutes writing back to SQL, especially if there were where clauses on tables of 5k plus rows.
I have now got this down to 10 seconds using this method:
Create a SharePoint list identical to the SQL table you want to patch
Patch everything to this list
Add a flow to do the legwork of updating the on Prem sql table with the SharePoint list data (this takes the load off of powerapps and the user experience)
In the flow Ensure that the list is cleared once the data is uploaded to sql.
You will also have to ensure that the user cannot reload data whilst the flow is running(as there is slight delay), you can get round this in powerapps by checking if the SharePoint list IsEmpty (you could also apply filters if there are writes from multiple people on different data)

I thought this maybe helpful to people as at the end of the day the app has to be quick for the users and no one wants to be waiting.
3 REPLIES 3
Highlighted
Community Support
Community Support

Re: Those of you Using OnPrem SQL - Help with speed

Hi @Delid4ve,

 

Thanks a lot for your sharing, I believe others who have the similar issue will benefit for your post.

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Helper II
Helper II

Re: Those of you Using OnPrem SQL - Help with speed

 Do you have a write up or example related to this? I am having trouble with the flow to move from list -> sql table

Highlighted
Impactful Individual
Impactful Individual

Re: Those of you Using OnPrem SQL - Help with speed

1: Update the sharepoint list from powerapps

2: Add a flow with trigger set to powerapps (you should call this flow in your app code directly after updating the sharepoint list)

3:In your flow:

  • 1st action: Get rows (sharepoint list)
  • 2nd action: Update rows (SQL), select the correct table and then use the fields from the sharepoint list. (this will add an apply to each around the action)

You will probably need to add a condition 1st within the apply to each if you are adding AND updating so it knows whether to add the row or update.

 

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (3,449)