US 11,928,114 B2
Query generation based on a logical data model with one-to-one joins
Naman Shah, Sunnyvale, CA (US); Rakesh Kothari, San Jose, CA (US); and Vaibhav Agarwal, Cupertino, CA (US)
Assigned to ThoughtSpot, Inc., Mountain View, CA (US)
Filed by ThoughtSpot, Inc., Sunnyvale, CA (US)
Filed on Apr. 21, 2020, as Appl. No. 16/854,219.
Claims priority of provisional application 62/837,426, filed on Apr. 23, 2019.
Prior Publication US 2020/0341978 A1, Oct. 29, 2020
Int. Cl. G06F 15/16 (2006.01); G06F 16/21 (2019.01); G06F 16/22 (2019.01); G06F 16/2453 (2019.01); G06F 16/2455 (2019.01)
CPC G06F 16/2456 (2019.01) [G06F 16/211 (2019.01); G06F 16/2246 (2019.01); G06F 16/2282 (2019.01); G06F 16/24534 (2019.01)] 20 Claims
OG exemplary drawing
 
1. A method comprising:
accessing a first join graph representing tables in a database, wherein the first join graph has vertices corresponding to respective tables in the database and directed edges corresponding to join relationships, wherein the directed edges are unidirectional;
receiving a first query that references data in two or more of the tables of the database;
selecting a connected subgraph of the first join graph that includes the two or more tables referenced in the first query;
accessing an indication that a directed edge of the connected subgraph corresponds to a one-to-one join;
modifying the connected subgraph based on the indication to obtain a modified subgraph, wherein the modified subgraph has less root tables than the connected subgraph;
generating one or more queries that reference respective subject tables that are each a root table of the modified subgraph or a table including a measure referenced in the first query;
generating a query graph that specifies joining of results based on the one or more queries to obtain a transformed query result for the first query, wherein the query graph has a single root node corresponding to the transformed query result;
invoking a transformed query on the database that is based on the query graph and the one or more queries to obtain the transformed query result; and
presenting data based on the transformed query result.