You can write a query in DDSQL Editor in natural language or in SQL. See the DDSQL reference for supported SQL expressions and usage details. Example queries are also provided throughout the UI.
To run a natural language query, type your question into the search bar, or click on one of the provided examples below the search bar.
To run a SQL query, type a valid DDSQL expression into the top section of the page, or run one of the examples listed under Queries to get you started.
If you aren’t sure which fields contain the data you want, you can use the schema explorer to examine the available tables, their columns, and their relationships to other tables:
Click the database icon in the left sidebar to open the schema explorer.
The current query is for the host table, so click All Tables > Hosts > host to view the available fields. Decide which field to add to the query. This example uses availability_zone.
Edit the query SQL to add the availability_zone to the result:
Tags can be queried as if they are table columns. Add a WHERE clause to the query to only count instances in production:
SELECTinstance_type,availability_zone,COUNT(*)AScountFROMhostWHERE#env='prod'-- Use '#' in front of tag names
GROUPBYinstance_type,availability_zoneORDERBYcountDESC;
If you forget to save a useful query before navigating away from it, you can still access it in the Recent Queries pane. Click the clock icon in the left sidebar to view a list of recent queries.