Usage Considerations: Simple and Complex Queries - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

Users query their databases not for an answer as an end result, but for guidance for performing a business action that has optimal decisive effects. The actions taken cause your bottom line to change, not the answers that informed those actions.

The answers provided by simple queries tend to be more expected than not, while the answers provided by complex queries tend to produce far less certain answers that are that much richer for resolving the questions posed.

Consider the following case example from the financial industry. A bank offers its customers a financial instrument that a competitor has decided to offer without charge. If the bank does not respond to this challenge quickly, customers who are paying their idea of an unnecessary fee for the financial instrument under discussion may leave this bank for its competitor.

Suppose the bank responds to this situation by asking, "Which current customers use this product?" The most likely response to this information (a list of current customers) is to eliminate the fee for the product. This action is likely to forestall erosion of the customer base, but also reduces profits for the bank.

Suppose the bank asks the more sophisticated question, "Which current customers using this product remain profitable clients if the fee is eliminated?" The bank now knows not only which consumers of its financial instrument are profitable for reasons other than their consumption of that product, but which consumers do not otherwise contribute to the bottom line. The latter customer set can be released to the competition, which is unlikely to know that the new customers are not profitable.

The impact of this more complex query is profit maximization, and its example shows clearly the value of complex over simple queries.

Relationship between Query Complexity and the Value of Its Answer

A simple query typically accesses a small number of tables, as the following graphic shows.



The simplicity of such a query maps directly into the simplicity of its answer. That is, simple queries tend to deliver low-value answers which, in turn, enable low-value actions.

Complex queries investigate relationships among tables, in search of high-value answers that come from mining interrelationships among tables. The following graphic shows a query that accesses four tables, one table multiple times. A complex query can access up to 128 in a single join.



Query complexity exerts an I/O burden that commercial relational database management systems typically cannot handle, which is the principal reason that most data warehouse vendors advocate the use of summary data.

The relationship between query complexity and the extent of detail in the database is direct and profound. Summary data is often good enough to answer simple queries, but cannot deliver the answers that more complex queries seek. This is an extremely important concept to understand before designing your databases, because you must provide the level of detail in the data that can deliver answers to the types of questions you must ask.

Valuable Information and Time

The value of information is often inversely proportional to the length of time required to derive it.

As the following graphic shows, the more sophisticated the analysis, the less expected the answers. More explicitly, this principle can be stated as the more complex the query, the more likely that heretofore unknown information hidden in the data is revealed.


Complexity of query analysis

Sophisticated explorations of the data universe may take longer to produce results, but those results are invaluable to the business. A quick response is a minimal requirement for simple queries, but such queries rarely provide a business-critical response, and designing a database to make sure nothing but quick responses is the quickest path to failure for your data warehouse project. The parallel architecture built into Vantage makes sure that all queries are answered in an optimal time frame.

Your data warehouse can be a source of unimaginable information richness if designed with the thought that any question, no matter how involved or abstract, can be answered as readily as a simple query.