1

There is a database we use for archiving old data which I want to be 'serverless' so that it only fires up when we make a query.

I changed the size from standard to serverless without issues. I have not connected to this DB since making the change.

However it doesn't pause despite setting the auto-pause to 1 hour.

Looking in Query Performance Insight, I can see there is a query which regularly polls the DB for size information... every hour at least.

(@type int)SELECT file_id, name, size AS size_8KB, max_size AS max_size_8KB, ISNULL(FILEPROPERTY(name, 'SpaceUsed'), size) AS space_used_8KB FROM sys.database_files WHERE type = u/type ORDER BY size DESC

If Azure SQL Serverless thinks the DB is in use because Azure services are polling the DB several times an hour to get information, it'll never auto pause?

Am I doing something wrong?

3
  • Did you work out the source of this query in the end? I'm having a very similar problem, with a query that appears to be checking database size and the database not auto-pausing.
    – DaveF
    Apr 7, 2022 at 8:23
  • yes. stupidly, when you navigate to the database in the Azure web portal, it sends a query to the database, keeping it alive each time. The trick (for us at least) is leave it alone and don't keep checking on it.
    – Damo
    Apr 7, 2022 at 20:43
  • Thank you. That's very helpful. Now to track down whoever is leaving the portal open 24/7
    – DaveF
    Apr 10, 2022 at 21:23

1 Answer 1

0

Azure SQL Serverless "thinks" the DB is in use because the DB is in use!

You did a good investigation and you even found the query that is using it. Good!

Azure SQL Database Serverless will not pause if it keeps receiving requests.

So the solutions are:

  • Find who is making that request and stop it
  • Maybe serverless is not the right option for you and you can move to some S* plan

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .