Query Analysis

Why Trust Techopedia

What Does Query Analysis Mean?

Query analysis is a process used in databases which make use of SQL in order to determine how to further optimize queries for performance.

Advertisements

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.

Techopedia Explains Query Analysis

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.

Advertisements

Related Terms

Margaret Rouse
Editor

Margaret jest nagradzaną technical writerką, nauczycielką i wykładowczynią. Jest znana z tego, że potrafi w prostych słowach pzybliżyć złożone pojęcia techniczne słuchaczom ze świata biznesu. Od dwudziestu lat jej definicje pojęć z dziedziny IT są publikowane przez Que w encyklopedii terminów technologicznych, a także cytowane w artykułach ukazujących się w New York Times, w magazynie Time, USA Today, ZDNet, a także w magazynach PC i Discovery. Margaret dołączyła do zespołu Techopedii w roku 2011. Margaret lubi pomagać znaleźć wspólny język specjalistom ze świata biznesu i IT. W swojej pracy, jak sama mówi, buduje mosty między tymi dwiema domenami, w ten…