Aseem
Aseem

Reputation: 6787

How to create a physical storage table in bigquery

I have created a new dataset with physical billing enabled:

CREATE SCHEMA `project1.test_physical_storage`
  OPTIONS (
    default_partition_expiration_days = 29,
    default_table_expiration_days = 29,
    description = 'Testing physical storage ',
    location = 'US',
    max_time_travel_hours = 48,
    storage_billing_model = PHYSICAL
  );

Then I tried creating a new table in this dataset

create table `test_physical_storage.tabl1` (id int, name string) ;
insert into `test_physical_storage.tabl1` values(1,'abc'), (2,'xyz');

But I see that the table only has logical bytes. It doesnt have physical bytes.

enter image description here

Edit: After some time I was able to see physical bytes too. But there are still logical bytes. Shouldnt logical bytes become 0 ?

enter image description here

Upvotes: 0

Views: 462

Answers (2)

Aseem
Aseem

Reputation: 6787

Following is based on my discussion with GCP support:

  • Each table will show both logical and physical bytes irrespective of its storage_billing_model
  • If storage_billing_model = PHYSICAL then we will be charged only for physical storage
  • If storage_billing_model = LOGICAL (which is by default) then we will be charged only for logical storage.
  • It takes couple of minutes for the table stats to update.

Upvotes: 0

Nestor
Nestor

Reputation: 1377

Storage billing model of a dataset is set to LOGICAL by default, by updating to logical you will have to wait for about 24 hrs to take effect:

When you change a dataset's billing model, it takes 24 hours for the change to take effect.

You can visit this article for more information about Storage billing models:

https://cloud.google.com/bigquery/docs/updating-datasets#sql_4

Upvotes: 0

Related Questions