Margaret Rouse is an award-winning technical writer and teacher known for her ability to explain complex technical subjects simply to a non-technical, business audience. Over…
Query analysis is a process used in databases which make use of SQL in order to determine how to further optimize queries for performance.
Query analysis is an important aspect of query processing as it helps improve overall performance of query processing, which will speed up many database functions and aspects. To do this, a query optimizer analyzes a specific query statement and generates both remote and local access plans to be used on the query fragment, based on the resource cost of each plan.
The database will then choose whichever plan it believes will process the query with the least cost in resources.
In general, SQL queries are generated by applications and users are then sent to a federated database in order to retrieve data from sources. Based on the query statement, the SQL compiler then consults the data source wrapper and the information stored on the global catalog in order to help it process the query.
The information it retrieves include the data source, mappings, data and server attributes, nicknames, statistics and more. The query optimizer which facilitates the query analysis is actually part of the SQL compiler process.
Through the query optimizer, the compiler develops different plans, alternative strategies that can be used when processing the query. These are called access plans and they might call for the query to be processed by different elements.
These elements are:
The federated server
The data sources
A little bit of both
On relational databases, a pushdown analysis is performed. It determines which operations can be evaluated remotely based on the query statement and the knowledge it has of the capabilities of the data sources. Based on the results of this analysis, the query optimizer will choose the best access plan with the least resource cost.
Techopedia’s editorial policy is centered on delivering thoroughly researched, accurate, and unbiased content. We uphold strict sourcing standards, and each page undergoes diligent review by our team of top technology experts and seasoned editors. This process ensures the integrity, relevance, and value of our content for our readers.
Margaret is an award-winning technical writer and teacher known for her ability to explain complex technical subjects to a non-technical business audience. Over the past twenty years, her IT definitions have been published by Que in an encyclopedia of technology terms and cited in articles by the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine, and Discovery Magazine. She joined Techopedia in 2011. Margaret's idea of a fun day is helping IT and business professionals learn to speak each other’s highly specialized languages.
What is Differential Privacy? Differential privacy is a mathematical framework for determining a quantifiable and adjustable level of privacy protection....
Margaret RouseTechnology Expert
What is cPanel Used For? cPanel is a crucial tool to help you access hosting features via a simple, non-technical...
Ilijia MiljkovacTechnology Writer
What is Operational Technology? Operational Technology, or OT, refers to the hardware and software systems that are used to control...
Marshall GunnellIT & Cybersecurity Expert
Trending NewsLatest GuidesReviewsTerm of the Day