Database Reference
In-Depth Information
to buy, run, and maintain. Moreover, the cluster of machines you're using
to run your query needs to be shared across multiple users who may be
running queries at the same time. If someone at Company A is running giant
queries, he shouldn't affect your ability to run queries. These factors are
what drive the quota and billing policies for BigQuery.
What Does It Cost to Run My Query?
As of the time of publication, BigQuery queries cost $5 per TB scanned,
whether they're for interactive or batch queries. These numbers are likely to
change in the future; if they do change, they will probably go down. (This
is based on assumptions made about costs of processing over time, not on
any inside information about pricing plans.) If you care about how much
your queries cost, you should check out the BigQuery pricing page here:
https://developers.google.com/bigquery/pricing . Google also
offers reserved instances for users who expect to run a lot of queries.
If the query cost is measured in dollars per byte scanned, how do you know
how many bytes are going to be scanned? Every query in BigQuery does
a full-table scan. That is, if the query requires reading even a single row
from a table, BigQuery reads all the rows. Even if you add a LIMIT clause
to a query, it still requires reading all the rows because LIMIT limits only
the results, not the amount of data read in the first place. This behavior is
different from traditional databases, which use indexes to avoid having to
read portions of a table.
Although you do need to read all the rows of the table, you won't necessarily
read all the columns. In practice, most queries actually read only a few
columns from a table. Because BigQuery stores data in columnar format, it
needs to read only the columns used in the query, and the other columns can
be left alone. This is, again, different from a traditional relational database,
where rows are stored together; so if you need to read part of a row, the
database would need to read the whole thing.
BigQuery enables users to take advantage of the column-store format; you
get charged for reading only the columns that are used in your query.
Although the columns are stored compressed, the amount charged is based
on the uncompressed size. One rationale behind charging for uncompressed
data rather than compressed data size is that it makes it easier for people to
understand how much they are being charged.
Search WWH ::




Custom Search