user3853657
user3853657

Reputation: 239

Standard or Legacy SQL for Google Analytics Data in BigQuery?

we are just starting to use Google Analytics data in BigQuery and previously used just the MSSQL Server in the work environment. We would like to move some of the analysis to the GCP and BigQuery, but could not decide on what is the better option to use - standard or legacy SQL?
In both cases we would have to adjust to the new language version, but the real question is what is the best choice when it comes to Google Analytics data analysis? Is there something that from the technical point of view should make us choose legacy over standard, or the other way around? It is very misleading for us that there are two versions, because legacy seems to be more developed now, but perphaps standard will be the main version for SQL in the future in BQ?

Upvotes: 2

Views: 8286

Answers (3)

Mikhail Berlyant
Mikhail Berlyant

Reputation: 173121

BigQuery Standard SQL is the way to go. It has much more features than Legacy SQL.

Note: it is not binary choice. You always can use Legacy SQL - if there is something that you will find easier to express with it. From my experience it is mostly opposite - with very few exceptions. Most prominent (for me for example being) - Table Decorators - Support for table decorators in standard SQL is planned but not yet implemented.

I would recommend looking into Migrating from legacy SQL - not from migration point of view as you are the new to BigQuery - but because it is a good place to see and compare features of both dialects in one place.

Also I recommend to check BigQuery Issue Tracker so you can get some extra insight

Upvotes: 3

Pentium10
Pentium10

Reputation: 208002

Go with Standard SQL, as that's on the longterm roadmap.

From experience some queries are faster under Legacy SQL, but this is changing as Standard SQL is the one that is actively developed.

Upvotes: 1

Elliott Brossard
Elliott Brossard

Reputation: 33765

Standard SQL is the preferred SQL dialect for use in BigQuery, as stated in the migration guide. While legacy SQL has been around for quite some time--and is still the default at the time of this writing--there is no active development work on it. If you are evaluating which to use, you should pick standard SQL, since in addition to being more similar to T-SQL (SQL Server's dialect) it is more expressive, has fewer surprising edge cases, and generally has more features.

Upvotes: 3

Related Questions