<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>OpenText Analytics Database 26.2.x – Managing queries</title>
    <link>/en/admin/managing-queries/</link>
    <description>Recent content in Managing queries on OpenText Analytics Database 26.2.x</description>
    <generator>Hugo -- gohugo.io</generator>
    
	  <atom:link href="/en/admin/managing-queries/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Admin: Query plans</title>
      <link>/en/admin/managing-queries/query-plans/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/admin/managing-queries/query-plans/</guid>
      <description>
        
        
        &lt;p&gt;When you submit a query, the query optimizer quickly chooses the projections to use, optimizes and plans the query execution, and logs the SQL statement to its log. This planning results in an &lt;em&gt;query plan&lt;/em&gt;, which maps out the steps the query performs.&lt;/p&gt;
&lt;p&gt;A query plan is a sequence of step-like &lt;a class=&#34;glosslink&#34; href=&#34;../../../en/glossary/path-quality-plan/&#34; title=&#34;The execution strategy of the OpenText&amp;amp;trade; Analytics Database cost-based query optimizer, denoting a sub operation in the query plan.&#34;&gt;paths&lt;/a&gt; that the cost-based query optimizer uses to execute queries. OpenText™ Analytics Database can produce different query plans for a given query. For each query plan, the query optimizer evaluates the data to be queried: number of rows, column statistics such as number of distinct values (cardinality), distribution of data across nodes. It also evaluates available resources such as CPUs and network topology, and other environment factors. The query optimizer uses this information to develop several potential plans. It then compares plans and chooses one, generally the plan with the &lt;a href=&#34;../../../en/admin/managing-queries/query-plans/query-plan-cost-estimation/&#34;&gt;lowest cost&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The optimizer breaks down the query plan into smaller &lt;a href=&#34;../../../en/admin/managing-queries/query-plans/viewing-query-plans/local-query-plans/&#34;&gt;local plans&lt;/a&gt; and distributes them to &lt;a href=&#34;../../../en/glossary/executor-node/&#34;&gt;executor nodes. The executor nodes process the smaller plans in parallel. Tasks associated with a query are recorded in the executor&#39;s log files.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In the final stages of query plan execution, the initiator node performs the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Combines results in a grouping operation.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Merges multiple sorted partial result sets from all the executors.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Formats the results to return to the client.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Before executing a query, you can &lt;a href=&#34;../../../en/admin/managing-queries/query-plans/viewing-query-plans/&#34;&gt;view its plan&lt;/a&gt; in by embedding the query in an &lt;a href=&#34;../../../en/sql-reference/statements/explain/#&#34;&gt;EXPLAIN&lt;/a&gt; statement; you can also view it in the Management Console.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Admin: Directed queries</title>
      <link>/en/admin/managing-queries/directed-queries/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/admin/managing-queries/directed-queries/</guid>
      <description>
        
        
        &lt;p&gt;&lt;em&gt;Directed queries&lt;/em&gt; encapsulate information that the optimizer can use to create a query plan. Directed queries can serve the following goals:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Preserve current query plans before a scheduled upgrade. In most instances, queries perform more efficiently after a database upgrade. In the few cases where this is not so, you can use directed queries that you created before upgrading, to recreate query plans from the earlier version.&lt;/li&gt;
&lt;li&gt;Enable you to create query plans that improve optimizer performance. Occasionally, you might want to influence the optimizer to make better choices in executing a given query. For example, you can choose a different projection, or force a different join order. In this case, you can use a directed query to create a query plan that preempts any plan that the optimizer might otherwise create.&lt;/li&gt;
&lt;li&gt;Redirect an input query to a query that uses different semantics—for example, &lt;a href=&#34;../../../en/admin/managing-queries/directed-queries/rewriting-queries/#Rewritin&#34;&gt;map a join query to a SELECT statement that queries a flattened table&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;directed-query-components&#34;&gt;Directed query components&lt;/h2&gt;
&lt;p&gt;A directed query pairs two components:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Input query&lt;/strong&gt;: A query that triggers use of this directed query when it is active.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Annotated query&lt;/strong&gt;: A SQL statement with embedded optimizer hints, which instruct the optimizer how to create a query plan for the specified input query. These hints specify important query plan elements, such as join order and projection choices.

&lt;div class=&#34;alert admonition tip&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Tip&lt;/h4&gt;

You can also use most optimizer hints directly in vsql. For details, see &lt;a href=&#34;../../../en/sql-reference/language-elements/hints/#&#34;&gt;Hints&lt;/a&gt;.

&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;OpenText™ Analytics Database provides two methods for creating directed queries:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The optimizer can generate an annotated query from a given input query and pair the two as a directed query.&lt;/li&gt;
&lt;li&gt;You can write your own annotated query and pair it with an input query.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For a description of both methods, see &lt;a href=&#34;../../../en/admin/managing-queries/directed-queries/creating-directed-queries/#&#34;&gt;Creating directed queries&lt;/a&gt;.&lt;/p&gt;

      </description>
    </item>
    
  </channel>
</rss>
