Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Suggested answer

How does performe quering to a local database through a data gateway vary versus a cloud database?

(1) ShareShare
ReportReport
Posted on by 23
I have a performance issue associated with a Power Apps application that through Power Automate flows queries an On-premise SQL database through a Gateway. I would like to know if this slowness is mainly due to the architecture of the solution. I have already tried running the Tscipts in SQL where the queries take milliseconds and the cost is very low. I can only think that this slowness is due to the fact that the database is not of cloud type.
 
Any comments on this matter?
 
Thank you very much.
Categories:
  • lbendlin Profile Picture
    7,794 Super User 2025 Season 1 on at
    How does performe quering to a local database through a data gateway vary versus a cloud database?
    Please provide more details.
     
    - what is the setup of the gateway? How many cluster members? How many cores each? How much memory?  How far are they from the database (network latency)?
    - what's the payload size? (both the query text and the returned data)?  Do you observe query caching in the SQL server?
  • Suggested answer
    timl Profile Picture
    34,933 Super User 2025 Season 1 on at
    How does performe quering to a local database through a data gateway vary versus a cloud database?
    Hi bslahsen

    All things being equal, performance should be slightly better with SQL Server Azure. This is due to the reduced latency in needing to connect to the gateway, and then from the gateway to your actual SQL server. 
     
    If you can give us further details, perhaps we can give other suggestions to improve performance. For instance, I assume you're using a Flow to execute dynamic SQL. If you can extract some of this logic into SQL Views, you could connect directly to data without going through Power Automate which would improve performance. If you were to consume this View data through a gallery, Power Apps can batch the data retrieval and it can minimise data transfer through the use of explicit column selection. This 2 features would further help performance.
  • bslahsen Profile Picture
    23 on at
    How does performe quering to a local database through a data gateway vary versus a cloud database?
    FLMike, this question is oriented to the speed that a SQL-on premise configuration has versus a cloud-type SQL configuration, regardless of the code. I am just asking wich is faster 
  • Suggested answer
    Michael E. Gernaey Profile Picture
    40,786 Super User 2025 Season 1 on at
    How does performe quering to a local database through a data gateway vary versus a cloud database?
    Hi
     
    There isn't a way for us to tell you that.
     
    1) We are not able to verify your configuration
    2) we are not able to verify your Power Apps to Power Automate code
    3) we cannot verify your On Premise Gateway
     
    and so on, you get the picture.
     
    However, what you should be doing, if its a local Database is (if its sql) running profiler, and then run your App and Flow
    This way you can do 2 things
     
    1) Look in your Flow run at each action and see how long each took
    2) you can look at the profile created to see why things took a long time OR if they didn
     
    Thats how you find it.
     
     
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,609 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,946 Most Valuable Professional

Leaderboard