SQL query is written against tables.In order to execute a query, the Vertica database generates a query plan. Query plan is the sequence of steps used to determine the execution path & resource cost for each step. Cost calculated at each step in a query plan is the estimation of resources used like:
- Data distribution statistics
- Disk space
- Network bandwidth
- CPU speed
- Data segmentation across cluster
When you submit a query, the initiator chooses the projections to use, optimizes and plans the query execution. Planning and optimization are quick, requiring at most a few milliseconds.
Based on the projections chosen, the query plan that the optimizer produces is decomposed into “mini-plans.” These mini-plans are distributed to the other nodes, known as executors.The nodes process the mini-plans in parallel, interspersed with data movement operations.
The query execution proceeds with intermediate result sets (rows) flowing through network connections between the nodes as needed. In the final stages of executing a query plan, some wrap up work is done at the initiator, such as:
- Combining results in a grouping operation
- Merging multiple sorted partial result sets from all the executors
- Formatting the results to return to the client
Some small queries, for example, queries on replicated dimension tables, can be executed locally. In these types of queries, the query planning avoids unnecessary network communication.
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
- Features of HP Vertica
- K-Safety in HP Vertica
- Projections in HP-Vertica
- Advanced compression and encoding techniques in HP Vertica
- WOS and ROS storage in HP Vertica
- Merge operation in HP Vertica
- Difference between Vertica and Virtuoso
- Difference between Vertica and Yaacomo
- Difference between Vertica and Yanza
- Difference between Vertica and VoltDB
- Difference between Valentina Server and Vertica
- Difference between UniData,UniVerse and Vertica
- Difference between VelocityDB and Vertica
- Difference between Transbase and Vertica
- Difference Between Trafodion and Vertica
- Difference between Vertica and YugabyteDB
- SQL | SELECT Query
- SQL query to find second highest salary?
- Structured Query Language (SQL)
- Query Optimization in Relational Algebra
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.