Queries

What is a query?

When a user requires information from an external data warehouse, system cache, or metadata, the system triggers an event, called a query. Some functions, like Scheduled Pinboard, Monitor, or SpotIQ, also trigger queries.

Various kinds of user actions or system functions generate one or more queries.

For example,

  • A chart view from a search triggers one (1) query.

  • An Answer view that contains a table and two KPI charts triggers three (3) queries.

  • A Liveboard view may generate multiple queries when loading multiple visualizations.

Table 1. Query categories captured in the query_stats table
Categories Captured Notes

User actions

API calls in TSE use case

Scheduled pinboard

When RLS rules apply, the Liveboard visualizations trigger queries for each user.

Monitor

SpotIQ

Callhome

Sage index

Connections table_stats query

User access system default pinboard like all the default pinboard in Admin portal

Search answer

Table 2. User actions and number of triggered queries
Category Action Number of queries

Sage search

Search

1 query is fired if a chart is presented as the result, by default.

Multiple queries if headlines are enabled; each headline results in 1 query.

User opens a Liveboard

A Liveboard may have multiple visuals. The system issues a query to load the first several visualizations to render on the Liveboard. As the user scrolls large Liveboards, the system issues additional queries to load more visualizations.

User opens an Answer in a Table view.

1 query is made to fetch the table data.

For every column, a headline query is fired. Maximum 20 headlines per table.

User opens an Answer in Chart view.

User adds an existing column from the data source to the search by selecting the left panel

1 query on Enter or Go.

The user adds an existing formula, previously created on the data source for this Answer, to the search by selecting the left panel

1 query on Enter or Go.

The user successfully adds a filter to an Answer from the left panel

1 query on Enter

A user successfully changes an existing filter.

1 query on Enter

A user either creates or changes a formula on an Answer.

1 query on Enter

User Changes from table to chart 1st time

  1. A user changes query in chart and changes back to the table

  2. A user does not change anything in chart and switches BACK to the table

Query is fired

  1. 1 query

  2. No Query is fired

User changes from chart to table

  1. A user changes query in a chart and switches back to table

  2. A user does not change anything in the chart and switches back to the table

Query is fired

  1. 1 query

  2. No Query is fired

User transforms a table in Answer or on a Pinboard Viz - this includes changing aggregation, filtering and sorting from the column header, filtering from the cell contents.

Transformation fires query

  • Sort -1 query is fired for every sort

  • Changing aggregation - 1 query is fired for every aggregation applied

  • Filtering - 1 query is fired for every filter

User selects a follow-up in Explore, this indicates that the user views a follow-up, which is produced by a search event.

Drill

User drills down on an Answer or visualization

1 query for each drill action

Explore

Every time that a user use any part of the explore function to update the chart or Answer

Liveboard views

Aggregate events of pinboard/answer/Mobile-viz view

One pinboard may have multiple Viz. When opening up one pinboard, a query will be sent to load the first x number of Viz to be shown on the web; later if the customer scrolls down, then the 2nd query will be fired to load more Viz on the web.

Scheduled pinboard

The query count depends on 2 factors: # of user groups (as row based security applied) involved, and # of Viz that this pinboard has.

Download data from an opened Answer

If an Answer is already open, click on download either chart or the table

Only table download will trigger the query, chart download does not. Table download will trigger a single query.

Pin a chart to pinboard

If a user pins a new chart to the pinboard (existing or create a new pinboard)

No query is fired for the pinning action itself

Update a chart in pinboard

Every time a user selects edit of a chart and makes x number of changes to the underlying chart, selects update or close and returns back to the pinboard

One query is fired for each change, plus 1 query when the chart is updated and returned to the pinboard.

During the creation of a Model

After adding multiple tables in a Model with joins between them, data is inspected in "Data Samples tabs"

No query is fired

Share

Share an object with others

No query is fired

Chart type change

If we change chart type, will there be a query fired?

Yes

Undo/Redo

In the search data portion, there is an undo/redo button. In what condition, will a query be fired?

We count the rows of data that can be searched. ThoughtSpot accesses data though connections from external data sources, searchable in TS. Data is brought into ThoughtSpot through a Connection to an external Cloud data warehouse or through (Free Trial only) CSV upload. The same data may be labeled multiple times under different table names and applied with different security rules by different users. We calculate the total row count across all these tables. A ThoughtSpot view is also treated as a table.

Search Index token: ThoughtSpot search engine indexes both table column names and values of attribute column values. Those non-date values are cached locally, and will be used for auto-completion when a user tries to type the name in the search bar. Each cached value will be considered as an index token.


Was this page helpful?