Imported Azure SQL Database is smaller and way slower

Dear reader,

First let me explain the context. I have two tenants. Tenant one had a Azure SQL Database (Basic tier, 2GB, 5 DTUs, LRS). I had to export the database and import it to Tenant two which has the same Azure SQL DB (Basic tier). I used the export functionality in the portal to export the original DB which gave me a 200 MB .bacpac file. I imported this .bacpac to the new tenants Azure SQL DB.

Size original DB:

Used space: 1.52 GB

Allocated space: 1.83 GB

New imported DB:

Used space: 1.1 GB

Allocated space: 1.14 GB

So I already thought the new size difference was a little bit weird. But the application which uses the new DB didn’t seem to notice any impact of this weird difference. The old DB contains a 9 million records postal table which runs queries like get streetname for postal code x and housenumber y. The old DB returns the results in a few ms. The new imported DB however takes around 3 minutes! for the same query. I’m not a DB performance expert but I know something went wrong looking at the size difference. Does anyone know what happened? Or does anybody know a fix for this?

Thanks in advance,

Gerrit.

Read more here: Source link