What is a scheduled query?
Scheduled queries are a useful feature offered by BigQuery that enables you to run queries on a recurring basis. These queries are written in SQL and can include both data definition language (DDL) and data manipulation language (DML). With scheduled queries, you can perform multiple actions such as creating, querying, and deleting temporary tables. You have the option to save the results of a scheduled query to a destination table or use the "Create Table" statement within the query itself.
How do I set up a Scheduled Query in PAD?
1. Open PAD and use the Editor in the BigQuery console to write your query. You can run your query to ensure the produced results are what you expect. Once satisfied with your query, click Schedule and Create new scheduled query.
2. This will open a New Scheduled Query pane on your screen. Under Details and schedule, you will specify the configuration of your query:
- Type what you would like to call your query in the Name for the scheduled query field. The name can be any value but you should make sure it is something you can identify later if you need to modify the query
- By default, scheduled queries are set to run daily. However, you can change this by selecting an option from the Repeat frequency dropdown. To specify a custom frequency, select Custom and then enter your time specification in the Custom schedule field. NOTE: the minimum duration between scheduled query runs is 15 minutes.
3. If you wish to save the results of a “SELECT” query, you can specify the dataset and table id under Destination for query results. Here, you can also choose whether you want to overwrite or append to the table.
4. To ensure you are aware if your scheduled query fails, CTA recommends checking the email notifications box under Advanced options.
When should I use a scheduled query?
Scheduled queries can be incredibly useful in a number of ways. One such way is to create updated tables that can be used to build visualizations in SketchPAD. If your dashboard is based on complicated queries, it may take a long time to load. However, by using a scheduled query, you can produce a table with the exact data you need, which can significantly improve the performance of your dashboard.
Have questions? Contact us a help@techallies.org!
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article