Queries automatically run on the Periscope Cache if the underlying tables are cached and the SQL is Redshift-compatible. If the query fails on the Cache, Periscope Data will run it directly against the source database.
The database that the query is running against can be determined by hovering over the info icon in the chart editor. A green dot indicates that the query was run on the cache, while a red dot indicates that the query ran directly on the source database.
Note: This functionality is only available with the cache add-on.
To ensure that the query doesn't fall back to the source database, add
-- --yes_cache (for MySQL) to the top of the query.
For example, if a chart using a view called
panthers_stats is showing an error about a nonexistent column, it may be falling back to the source database and giving an unhelpful error message.
--yes_cache to the top of the query ensures that it doesn't fall back to the source database, where
panthers_stats doesn't exist.
Now the chart shows a more relevant error.
To run queries against the source database directly, there is a similar syntax. Add
-- --no_cache (for MySQL) to the top of a query to skip the Periscope Cache.