Avoid high daily charges with Cloud SQL

Cloud SQL does not charge you by the queries you perform, it charges you by the instance you use.

This is mentioned in the Cloud SQL docs like @cory-kramer said:

Cloud SQL pricing is composed of the following charges:

  • CPU and memory pricing
  • Storage and networking pricing
  • Instance pricing

The costs in the pricing docs are per hour per vCPU and per hour per GB of memory. Those are the double if you use HA instances.

From the screenshot, I can say you created a HA Cloud SQL instance because it says Regional (BTW it is not necessary to hide the SKUs, those are public and are the same for everybody).

Let's suppose you have a HA instance using Postgres with 4 vCPU and 15 GB RAM with 10 GB of disk in us-central1.

Using the GCP Calculator we get an estimate of $397.89 USD a month for just 1 instance.

Now a follow up question could be, "If I used the instance only 1 day or 2 days, the report says I used more than 24 or 48 hours".

The reason is that the vCPU is multiplied as cores the instance has. This also applies for the RAM and it is very similar to how GCE VMs are charged.

The formulas are:

cpu_hours = vCPUs * 24 hrs * days instance was active

memory_hours = RAM * 24 hrs * days instance was active

To avoid a lot of charges you can start/stop daily the instance or if this is a development instance you can decrease the hardware to a very little instance like 1 vCPU, 0.614 GB or the minimum necessary hardware to work. Also you can make it zonal(not HA)

Also the prices change depending on the regions those are created.

My advice here is to fully understand the pricing before creating resources to avoid any surprise. I understand the docs can be confusing but it's better to take the needed time to check them so you can optimize your budget.