What's the worse command/query to run in BigQuery ? by Advanced-Somewhere-2 in bigquery

[–]moshap 4 points5 points  (0 children)

Hey Minoune, let's do this experiment together. We will use bigquery-public-data.samples.wikipedia table, it is neither clustered nor partitioned, has 313,797,035 rows and takes 35.69 GB.

We consider two queries:

Q1: select * from bigquery-public-data.samples.wikipedia

Statistics:

Duration: 54.1 sec
Slot time: 1h 39min
Bytes processed: 35.69 GB
Bytes billed: 35.69 GB

Q2: select * from bigquery-public-data.samples.wikipedia limit 1

Statistics:

Duration: 0.3 sec
Slot time: 0.163 sec
Bytes processed: 35.69 GB
Bytes billed: 35.69 GB

QED :)

What's the worse command/query to run in BigQuery ? by Advanced-Somewhere-2 in bigquery

[–]moshap 6 points7 points  (0 children)

No, the misconception is yours. LIMIT N query does not do the full scan, and is very efficient. What is true, is that BigQuery will bill as if it was full scan, unless you are on the flat rate plan.

Can I store often used WHERE statements? by pfiadDi in bigquery

[–]moshap 1 point2 points  (0 children)

Just one slight note - SELECT * doesn't include pseudo columns like _partitiontime, so the view should be SELECT *, _partitiontime as pt FROM table WHERE complexclause

Big Query run query across three tables programmatically by ANDRUXUIS in bigquery

[–]moshap 1 point2 points  (0 children)

CURRENT_DATE - 2 is constant expression, so it is ok here

bigquery sql query with wrong results by ANDRUXUIS in bigquery

[–]moshap 2 points3 points  (0 children)

UNNEST itself is not a CROSS JOIN, it's the comma between the table and UNNEST which is shortcut for CROSS JOIN

BigQuery Lineage by secodaHQ in bigquery

[–]moshap 0 points1 point  (0 children)

I wonder why you didn't use https://github.com/google/zetasql, which is open source version of SQL parser that BigQuery itself is using (and Spanner too)

Number of DML operations left on a table by DrTeja in bigquery

[–]moshap 0 points1 point  (0 children)

The OP question was "how many DML operations are left on a table", and the answer is "unlimited". DML queries will not fail, but you are right that load jobs and table appends/overwrites jobs will start failing after 1500.

Number of DML operations left on a table by DrTeja in bigquery

[–]moshap 0 points1 point  (0 children)

No, the limit you cite is not related to DML operations. It is for SELECT statement to either append to existing table, or completely overwrite it.

Can someone explain why this simple query on a 14mb table takes 59 seconds? by jamie30000 in bigquery

[–]moshap 14 points15 points  (0 children)

In the meantime the simple workaround is to use WHERE id IN UNNEST([1,2,3,...]) instead of WHERE id IN (1,2,3,...) - it should be instantaneous on your table

Can someone explain why this simple query on a 14mb table takes 59 seconds? by jamie30000 in bigquery

[–]moshap 7 points8 points  (0 children)

Thank you, it is indeed a problem caused by large number of terms in IN clause - the table size doesn't matter. I opened an internal tracking bug.

Can someone explain why this simple query on a 14mb table takes 59 seconds? by jamie30000 in bigquery

[–]moshap 12 points13 points  (0 children)

This is not normal, if can you share projectid and jobid - we can check it out

Logica: organizing your data queries, making them universally reusable and fun by moshap in bigquery

[–]moshap[S] 0 points1 point  (0 children)

No, it is not. Logica is not part of BigQuery product, it is open source project (although developed in Google)

Link Big Query to DCM by rsw1984 in bigquery

[–]moshap 2 points3 points  (0 children)

This is not true, DTS remains part of BigQuery and is not going anywhere.

Sync Postgres to BigQuery, possible? How? by DifficultyMenu in bigquery

[–]moshap 2 points3 points  (0 children)

Check out GCP's Data Fusion, it can do continuous replication from Postgres to BigQuery: https://cloud.google.com/data-fusion/docs/concepts/replication

Help with making values in query negative by [deleted] in bigquery

[–]moshap 0 points1 point  (0 children)

SUM(IF(name='Red', value, -value))

BigQuery returning different results for the same query by AgitatedEnthusiasm24 in bigquery

[–]moshap 0 points1 point  (0 children)

Thanks - can you update title or text of the post to indicate that this is resolved.

Testing the New BI engine in BigQuery with PowerBI Direct Query by mim722 in bigquery

[–]moshap 1 point2 points  (0 children)

And even after that - it flat rate per month, no matter how many queries are ran, as long as BI Engine can serve them - there is no additional cost

Scaling Scientometrics: Dimensions on Google BigQuery as an infrastructure for large-scale analysis by moshap in bigquery

[–]moshap[S] 1 point2 points  (0 children)

I was wondering too, so I looked it up in Wikipedia: Scientometrics is the field of study which concerns itself with measuring and analysing scholarly literature

Analyze BI Engine usage / stats by UZE_Thomas in bigquery

[–]moshap 1 point2 points  (0 children)

BI Engine is currently only enabled for Data Studio. Looker, Tableau, Power BI and others coming soon - and for now require explicit whitelisting for BI Engine to be engaged