Summary
Highlights
The video introduces query processing and optimization. A database query is defined as a vehicle for extracting or updating data in a database management system. Query processing involves the activities that occur behind the scenes when selecting or modifying data.
The activities involved in query processing include translating a high-level query into an expression usable at the physical file system level, performing query optimization and transformation, and the actual evaluation of queries. The main aim is to transform high-level language queries into efficient low-level execution strategies.
Query processing consists of three main phases: Query Decomposition (parsing and translation), Optimization, and Evaluation. These phases manage the flow of a query through the database management system.
Query decomposition is the first phase, involving parsing and translation. Its goal is to transform a high-level query into a relational algebraic query and to check for syntactic and semantic correctness. This process transforms high-level languages into relational algebraic forms, ensuring the query is valid and well-formed.
Query decomposition tokenizes each part of the query, such as relation names, table names, or attribute names. For example, a SQL query like 'SELECT all FROM book WHERE price > 100' is broken down, and the scanner identifies the language elements. The tokens are then translated into internal data and structural elements, forming an equivalent relational algebra expression, often represented as a query tree or graph data structure.