# BigQuery Best Practices

***

### Cost Reduction

* Avoid using `SELECT *`
* Price your queries before running them
* Use clustered or partitioned tables
* Use streaming inserts with caution
* Materialize query results in stages

***

### Query Performance

* Filter of partitioned or clustered column

* Try denormalizing data
  * Use nested or repeated columns in case you have a complicated structure

* Use external data sources appropriately
  * It might incur more costs if&#x20;

* Reduce data before using a JOIN

* Do not treat WITH clauses as prepared statements

* Avoid oversharding tables

* Avoid JavaScript user-defined functions

* Use approximate aggregation functions (HyperLogLog++)

* Order Last,&#x20;

***

***

***
