<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>OpenText Analytics Database 26.2.x – Query plans</title>
    <link>/en/admin/managing-queries/query-plans/</link>
    <description>Recent content in Query plans on OpenText Analytics Database 26.2.x</description>
    <generator>Hugo -- gohugo.io</generator>
    
	  <atom:link href="/en/admin/managing-queries/query-plans/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Admin: Viewing query plans</title>
      <link>/en/admin/managing-queries/query-plans/viewing-query-plans/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/admin/managing-queries/query-plans/viewing-query-plans/</guid>
      <description>
        
        
        &lt;p&gt;You can obtain query plans in two ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;a href=&#34;../../../../en/sql-reference/statements/explain/#&#34;&gt;EXPLAIN&lt;/a&gt; statement outputs query plans in various text formats (see &lt;a href=&#34;#top&#34;&gt;below&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Management Console provides a graphical interface for viewing query plans. For detailed information, see &lt;a href=&#34;../../../../en/mc/db-management/working-with-query-plans-mc/#&#34;&gt;Working with query plans in MC&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can also observe the real-time flow of data through a query plan by querying the system table &lt;a href=&#34;../../../../en/sql-reference/system-tables/v-monitor-schema/query-plan-profiles/#&#34;&gt;QUERY_PLAN_PROFILES&lt;/a&gt;. For more information, see &lt;a href=&#34;../../../../en/admin/profiling-db-performance/profiling-query-plans/#&#34;&gt;Profiling query plans&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;explain-output-options&#34;&gt;EXPLAIN output options&lt;/h2&gt;
&lt;p&gt;By default, EXPLAIN output represents the query plan as a hierarchy, where each level, or &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;path&lt;/a&gt;, represents a single database operation that the optimizer uses to execute a query. EXPLAIN output also appends DOT language source so you can display this output graphically with open source &lt;a href=&#34;http://graphviz.org/&#34;&gt;Graphviz&lt;/a&gt; tools.&lt;/p&gt;
&lt;p&gt;EXPLAIN supports options for producing &lt;a href=&#34;../../../../en/admin/managing-queries/query-plans/viewing-query-plans/verbose-query-plans/&#34;&gt;verbose&lt;/a&gt; and &lt;a href=&#34;../../../../en/admin/managing-queries/query-plans/viewing-query-plans/json-formatted-query-plans/&#34;&gt;JSON&lt;/a&gt; output. You can also show the &lt;a href=&#34;../../../../en/admin/managing-queries/query-plans/viewing-query-plans/local-query-plans/&#34;&gt;local query plans&lt;/a&gt; that are assigned to each node, which together comprise the total (global) query plan.&lt;/p&gt;
&lt;p&gt;EXPLAIN also supports an ANNOTATED option. EXPLAIN ANNOTATED returns a query with embedded optimizer hints, which encapsulate the query plan for this query. For an example of usage, see &lt;a href=&#34;../../../../en/admin/managing-queries/directed-queries/creating-directed-queries/using-optimizer-generated-and-custom-directed-queries-together/#&#34;&gt;Using optimizer-generated and custom directed queries together&lt;/a&gt;.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Admin: Query plan cost estimation</title>
      <link>/en/admin/managing-queries/query-plans/query-plan-cost-estimation/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/admin/managing-queries/query-plans/query-plan-cost-estimation/</guid>
      <description>
        
        
        &lt;p&gt;The query optimizer chooses a query plan based on cost estimates. The query optimizer uses information from a number of sources to develop potential plans and determine their relative costs. These include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Number of table rows&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Column statistics, including: number of distinct values (cardinality), minimum/maximum values, distribution of values, and disk space usage&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Access path that is likely to require fewest I/O operations, and lowest CPU, memory, and network usage&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Available eligible projections&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Join options: join types (merge versus hash joins), join order&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Query predicates&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Data segmentation across cluster nodes&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Many important optimizer decisions rely on statistics, which the query optimizer uses to determine the final plan to execute a query. Therefore, it is important that statistics be up to date. Without reasonably accurate statistics, the optimizer could choose a suboptimal plan, which might affect query performance.&lt;/p&gt;
&lt;p&gt;OpenText™ Analytics Database provides hints about statistics in the query plan. See &lt;a href=&#34;../../../../en/admin/managing-queries/query-plans/query-plan-information-and-structure/query-plan-statistics/#&#34;&gt;Query plan statistics&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;cost-versus-execution-runtime&#34;&gt;Cost versus execution runtime&lt;/h2&gt;
&lt;p&gt;Although costs correlate to query runtime, they do not provide an &lt;em&gt;estimate&lt;/em&gt; of actual runtime. For example, if the optimizer determines that Plan A costs twice as much as Plan B, it is likely that Plan A will require more time to run. However, this cost estimate does not necessarily indicate that Plan A will run twice as long as Plan B.&lt;/p&gt;
&lt;p&gt;Also, plan costs for different queries are not directly comparable. For example, if the estimated cost of Plan X for query1 is greater than the cost of Plan Y for query2, it is not necessarily true that Plan X&#39;s runtime is greater than Plan Y&#39;s runtime.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Admin: Query plan information and structure</title>
      <link>/en/admin/managing-queries/query-plans/query-plan-information-and-structure/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/admin/managing-queries/query-plans/query-plan-information-and-structure/</guid>
      <description>
        
        
        &lt;p&gt;Depending on the query and database schema, &lt;code&gt;EXPLAIN&lt;/code&gt; output includes the following information:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Tables referenced by the statement&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Estimated costs&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Estimated row cardinality&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Path ID, an integer that links to error messages and profiling counters so you troubleshoot performance issues more easily. For more information, see &lt;a href=&#34;../../../../en/admin/profiling-db-performance/profiling-query-plans/#&#34;&gt;Profiling query plans&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Data operations such as &lt;code&gt;SORT&lt;/code&gt;, &lt;code&gt;FILTER&lt;/code&gt;, &lt;code&gt;LIMIT&lt;/code&gt;, and &lt;code&gt;GROUP BY&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Projections used&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Information about statistics—for example, whether they are current or out of range&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Algorithms chosen for operations into the query, such as &lt;code&gt;HASH&lt;/code&gt;/&lt;code&gt;MERGE&lt;/code&gt; or &lt;code&gt;GROUPBY HASH&lt;/code&gt;/&lt;code&gt;GROUPBY PIPELINED&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Data redistribution (broadcast, segmentation) across cluster nodes&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;example&#34;&gt;Example&lt;/h2&gt;
&lt;p&gt;In the &lt;code&gt;EXPLAIN&lt;/code&gt; output that follows, the optimizer processes a query in three steps, where each step identified by a unique path ID:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;0: Limit&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;1: Sort&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;2: Storage access and filter&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&#34;../../../../images/query-plans/query-plan-diagram.png&#34; alt=&#34;&#34;&gt;

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

A storage access operation can scan more than the columns in the &lt;code&gt;SELECT&lt;/code&gt; list— for example, columns referenced in &lt;code&gt;WHERE&lt;/code&gt; clause.

&lt;/div&gt;&lt;/p&gt;

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