The result: a significant reduction in query costs and execution time.
- Click on the Integrations link in the sidebar of superQuery:
- Enable your desired connection by clicking “Connect”
- After clicking “Connect” you’ll see the username and password screen, like so:
- Whitelist your IP Address if necessary
- Copy the hostname and port from this window into your service of choice.
- server: bi.superquery.io
- port: 3306
6. Finalize the connection.
- Download RStudio
- In RStudio run the following from the console:
Connect RStudio to superQuery
- Open RStudio and create a new R script:
mydb = dbConnect(MySQL(), user='xxxx', password='xxxx', dbname='yourproject.yourdataset', host='bi.superquery.io')
rs = dbSendQuery(mydb, 'SELECT COUNT(*) FROM `yourproject.yourdataset.yourtable`;')
data = fetch(rs, n=-1)
rs_explain = dbSendQuery(mydb, 'explain;')
data_explain = fetch(rs_explain, n=-1)
data_explain = fromJSON(data_explain$statistics)
- Enter the following details into the script:
- Your username and password into the ‘xxxx’ parts
- yourproject, yourdataset and yourtable in the relevants parts.
- Run the script and you will see two variables were created:
The variable called “data” will contain your query results and the variable “data_explain” will contain your query’s execution plan and statistics. It should look like this:
Boom! You’re all set.
Now you can start building your own beautiful dashboards.
Query on! 🙂
Here are some ways you can organize boards and queries (okay, maybe not the last one 😉)
User Acquisition Board
- MRR Churn
- AVG MRR
- Gross Margin
Marketing Campaigns Board
- Easiest to Capture by Type
- Strongest by Type
- Strongest by Generation
- # Pokemon by Type