Connecting to Query Results (beta) 

The Query Results Data Source allows you to run queries on top of existing query results, so you can easily merge/refine results or perform any other kind of post-processing on the result set you already have:

  • Name: The name you wish to give to your Data Source

The naming convention when dealing with a Query Results Data Source is in the form of query__$QUERY-ID, where $QUERY-ID is the ID of your initial query that you wish to reuse the results of (that is, the number in the query URL).

For example, suppose your query is http://demo.redash.io/queries/7177. When referencing its results, you will use query__7177 as the table name.

By referencing the table after creating the Data Source (for example, query_555 and query_666), you will be able to execute queries like the following:

SELECT q1.name, q2.count FROM query_555 q1 JOIN query_666 q2 ON q1.id = q2.id

For this Data Source, you need to make sure that, when creating queries, the table name (for example, query_123) is on the same line as the FROM/JOIN keywords.

There are a few notes to consider:

  • In order to keep the query results as fresh as possible, the source queries (the queries that you use as the Data Source) are also being executed every time you run a query on this Data Source. This might be changed in the future to reduce the number of concurrent executing queries and repeated query runs.
  • The underlying engine that allows processing on this kind of Data Source is an in-memory SQLite database, so in case of operating with large datasets, you might hit an OOM (Out of Memory) error.
  • Access Control: As mentioned in #1, the source query is also being executed during the execution of the resulting query, and so the user that is executing it must have access and the right to execute on both the query and the source query. If they don't have the right to access or execute, the user will be able to see the query but not execute it.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.17.50