<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Hive Explain says &amp;quot;Plan not optimized by CBO due to missing statistics&amp;quot; but stats are present. What gives? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Hive-Explain-says-quot-Plan-not-optimized-by-CBO-due-to/m-p/97587#M60758</link>
    <description>&lt;P&gt;Did you run both table level and column level statistics:&lt;/P&gt;&lt;PRE&gt;analyze table t compute statistics;
analyze table t compute statistics for columns;&lt;/PRE&gt;&lt;P&gt;The log will be the hive client log (/tmp/&amp;lt;user&amp;gt;/hive.log) in case of hive cli, for hiveserver2 it will likely be /var/log/hive/hiveserver2.log (whatever you configured in Ambari).&lt;/P&gt;</description>
    <pubDate>Wed, 25 Nov 2015 07:24:17 GMT</pubDate>
    <dc:creator>deepesh1</dc:creator>
    <dc:date>2015-11-25T07:24:17Z</dc:date>
    <item>
      <title>Hive Explain says "Plan not optimized by CBO due to missing statistics" but stats are present. What gives?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-Explain-says-quot-Plan-not-optimized-by-CBO-due-to/m-p/97586#M60757</link>
      <description>&lt;P&gt;I'm running an explain on a query and the result includes "Plan not optimized by CBO due to missing statistics. Please check log for more details"&lt;/P&gt;&lt;P&gt;1. All the tables in the query have had compute statistics run on them and the describe formatted output shows that stats are present and up to date. What is missing?&lt;/P&gt;&lt;P&gt;2. Which log file is the message referring to? I looked in Hive the hiveserver2.log and can see the log entries for the explain command here but there's no explanation on what stats it thinks are missing.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2015 07:10:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-Explain-says-quot-Plan-not-optimized-by-CBO-due-to/m-p/97586#M60757</guid>
      <dc:creator>rtempleton</dc:creator>
      <dc:date>2015-11-25T07:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: Hive Explain says "Plan not optimized by CBO due to missing statistics" but stats are present. What gives?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-Explain-says-quot-Plan-not-optimized-by-CBO-due-to/m-p/97587#M60758</link>
      <description>&lt;P&gt;Did you run both table level and column level statistics:&lt;/P&gt;&lt;PRE&gt;analyze table t compute statistics;
analyze table t compute statistics for columns;&lt;/PRE&gt;&lt;P&gt;The log will be the hive client log (/tmp/&amp;lt;user&amp;gt;/hive.log) in case of hive cli, for hiveserver2 it will likely be /var/log/hive/hiveserver2.log (whatever you configured in Ambari).&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2015 07:24:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-Explain-says-quot-Plan-not-optimized-by-CBO-due-to/m-p/97587#M60758</guid>
      <dc:creator>deepesh1</dc:creator>
      <dc:date>2015-11-25T07:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: Hive Explain says "Plan not optimized by CBO due to missing statistics" but stats are present. What gives?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-Explain-says-quot-Plan-not-optimized-by-CBO-due-to/m-p/97588#M60759</link>
      <description>&lt;P&gt;Yes, I ran both. I executed the explain command from within the Ambari Hive view ( I realize not optimal for the result it produces) so I checked the hiveserver2.log. I don't see any info there regarding why it thinks the stats are missing or incomplete.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2015 08:00:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-Explain-says-quot-Plan-not-optimized-by-CBO-due-to/m-p/97588#M60759</guid>
      <dc:creator>rtempleton</dc:creator>
      <dc:date>2015-11-25T08:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Hive Explain says "Plan not optimized by CBO due to missing statistics" but stats are present. What gives?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-Explain-says-quot-Plan-not-optimized-by-CBO-due-to/m-p/97589#M60760</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/252/rtempleton.html" nodeid="252"&gt;@Ryan Templeton&lt;/A&gt; is your table partitioned? If I understood right, you must execute analyse command for each partition.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2015 19:52:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-Explain-says-quot-Plan-not-optimized-by-CBO-due-to/m-p/97589#M60760</guid>
      <dc:creator>gbraccialli3</dc:creator>
      <dc:date>2015-11-25T19:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: Hive Explain says "Plan not optimized by CBO due to missing statistics" but stats are present. What gives?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-Explain-says-quot-Plan-not-optimized-by-CBO-due-to/m-p/97590#M60761</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/252/rtempleton.html" nodeid="252" target="_blank"&gt;@Ryan Templeton&lt;/A&gt; &lt;A rel="user" href="https://community.cloudera.com/users/222/deepesh.html" nodeid="222" target="_blank"&gt;@Deepesh&lt;/A&gt; &lt;A rel="user" href="https://community.cloudera.com/users/238/gbraccialli.html" nodeid="238" target="_blank"&gt;@Guilherme Braccialli&lt;/A&gt;  &lt;A rel="user" href="https://community.cloudera.com/users/301/gopal.html" nodeid="301" target="_blank"&gt;@gopal&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Table is not partitioned. &lt;/P&gt;&lt;PRE&gt;create table batting (player_id STRING, year INT, runs INT);&lt;/PRE&gt;
&lt;P&gt;Column stats = None &lt;/P&gt;&lt;P&gt;0: jdbc:hive2://phdns02:10000&amp;gt; analyze table batting compute statistics;&lt;/P&gt;&lt;P&gt;INFO  : Session is already open&lt;/P&gt;&lt;P&gt;INFO  : Dag name: analyze table batting compute statistics(Stage-0)&lt;/P&gt;&lt;P&gt;INFO  : &lt;/P&gt;&lt;P&gt;INFO  : Status: Running (Executing on YARN cluster with App id application_1448374612679_0002)&lt;/P&gt;&lt;P&gt;INFO  : Map 1: 0/1&lt;/P&gt;&lt;P&gt;INFO  : Map 1: 0(+1)/1&lt;/P&gt;&lt;P&gt;INFO  : Map 1: 1/1&lt;/P&gt;&lt;P&gt;INFO  : Table default.batting stats: [numFiles=1, numRows=95196, totalSize=1653324, rawDataSize=1558128]&lt;/P&gt;&lt;P&gt;No rows affected (6.775 seconds)&lt;/P&gt;&lt;P&gt;0: jdbc:hive2://phdns02:10000&amp;gt; analyze table batting compute statistics for columns ;&lt;/P&gt;&lt;P&gt;INFO  : Session is already open&lt;/P&gt;&lt;P&gt;INFO  : Dag name: analyze table batting compute stat...columns(Stage-0)&lt;/P&gt;&lt;P&gt;INFO  : &lt;/P&gt;&lt;P&gt;INFO  : Status: Running (Executing on YARN cluster with App id application_1448374612679_0002)&lt;/P&gt;&lt;P&gt;INFO  : Map 1: 0(+1)/1Reducer 2: 0/1&lt;/P&gt;&lt;P&gt;INFO  : Map 1: 1/1Reducer 2: 0/1&lt;/P&gt;&lt;P&gt;INFO  : Map 1: 1/1Reducer 2: 0(+1)/1&lt;/P&gt;&lt;P&gt;INFO  : Map 1: 1/1Reducer 2: 1/1&lt;/P&gt;&lt;P&gt;No rows affected (3.131 seconds)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="586-screen-shot-2015-11-25-at-65410-am.png" style="width: 2238px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/23950iBA5A893001F3F3EA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="586-screen-shot-2015-11-25-at-65410-am.png" alt="586-screen-shot-2015-11-25-at-65410-am.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2019 12:45:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-Explain-says-quot-Plan-not-optimized-by-CBO-due-to/m-p/97590#M60761</guid>
      <dc:creator>nsabharwal</dc:creator>
      <dc:date>2019-08-19T12:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: Hive Explain says "Plan not optimized by CBO due to missing statistics" but stats are present. What gives?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-Explain-says-quot-Plan-not-optimized-by-CBO-due-to/m-p/97591#M60762</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/307/yzhang.html" nodeid="307"&gt;@yzhang&lt;/A&gt;    &lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2015 03:38:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-Explain-says-quot-Plan-not-optimized-by-CBO-due-to/m-p/97591#M60762</guid>
      <dc:creator>nsabharwal</dc:creator>
      <dc:date>2015-11-26T03:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: Hive Explain says "Plan not optimized by CBO due to missing statistics" but stats are present. What gives?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-Explain-says-quot-Plan-not-optimized-by-CBO-due-to/m-p/97592#M60763</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/252/rtempleton.html" nodeid="252"&gt;@Ryan Templeton&lt;/A&gt; Launching a support case will be a good idea. &lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2015 04:31:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-Explain-says-quot-Plan-not-optimized-by-CBO-due-to/m-p/97592#M60763</guid>
      <dc:creator>nsabharwal</dc:creator>
      <dc:date>2015-11-26T04:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: Hive Explain says "Plan not optimized by CBO due to missing statistics" but stats are present. What gives?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-Explain-says-quot-Plan-not-optimized-by-CBO-due-to/m-p/97593#M60764</link>
      <description>&lt;P&gt;If you are getting message "plan not optimized by CBO" when your table has statistics, please, check your hive log and look if you don't have message below:&lt;/P&gt;&lt;P&gt;"parse.BaseSemanticAnalyzer: Not invoking CBO because the statement has too few joins"&lt;/P&gt;&lt;P&gt;This message in log mean CBO wasn't used just because it wasn't needed, as your query may have few joins. The warning message in explain is not clear, as it says only "plan not optimized by CBO", but it's not an issue if you see the extra message in log file.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Feb 2016 21:49:16 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-Explain-says-quot-Plan-not-optimized-by-CBO-due-to/m-p/97593#M60764</guid>
      <dc:creator>gbraccialli3</dc:creator>
      <dc:date>2016-02-20T21:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: Hive Explain says "Plan not optimized by CBO due to missing statistics" but stats are present. What gives?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-Explain-says-quot-Plan-not-optimized-by-CBO-due-to/m-p/97594#M60765</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/238/gbraccialli.html" nodeid="238"&gt;@Guilherme Braccialli&lt;/A&gt;  "CBO because the statement has too few joins"  I guess it means that "missing statistics" message is normal. &lt;/P&gt;</description>
      <pubDate>Sat, 20 Feb 2016 21:57:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-Explain-says-quot-Plan-not-optimized-by-CBO-due-to/m-p/97594#M60765</guid>
      <dc:creator>nsabharwal</dc:creator>
      <dc:date>2016-02-20T21:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: Hive Explain says "Plan not optimized by CBO due to missing statistics" but stats are present. What gives?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-Explain-says-quot-Plan-not-optimized-by-CBO-due-to/m-p/97595#M60766</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/238/gbraccialli.html" nodeid="238"&gt;@Guilherme Braccialli&lt;/A&gt; can you add more detail to the answer, used this thread as reference and it's unclear what solution is.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2016 08:54:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-Explain-says-quot-Plan-not-optimized-by-CBO-due-to/m-p/97595#M60766</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-03-15T08:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: Hive Explain says "Plan not optimized by CBO due to missing statistics" but stats are present. What gives?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-Explain-says-quot-Plan-not-optimized-by-CBO-due-to/m-p/97596#M60767</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/393/aervits.html" nodeid="393"&gt;@Artem Ervits&lt;/A&gt;, done, please check if it's clear now.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2016 21:54:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-Explain-says-quot-Plan-not-optimized-by-CBO-due-to/m-p/97596#M60767</guid>
      <dc:creator>gbraccialli3</dc:creator>
      <dc:date>2016-03-16T21:54:23Z</dc:date>
    </item>
    <item>
      <title>Re: Hive Explain says "Plan not optimized by CBO due to missing statistics" but stats are present. What gives?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-Explain-says-quot-Plan-not-optimized-by-CBO-due-to/m-p/97597#M60768</link>
      <description>&lt;P&gt;Hey guys! i am running into the same problem. When I look for stats for a specific column it showing me all other fileds  like min, max etc as blank My column level stats are showing as blank.  And when I take the plan on the query involving these tables i am getting the warning as Column stats = None Please help!&lt;/P&gt;</description>
      <pubDate>Sat, 10 Dec 2016 00:53:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-Explain-says-quot-Plan-not-optimized-by-CBO-due-to/m-p/97597#M60768</guid>
      <dc:creator>jaseemkh</dc:creator>
      <dc:date>2016-12-10T00:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: Hive Explain says "Plan not optimized by CBO due to missing statistics" but stats are present. What gives?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-Explain-says-quot-Plan-not-optimized-by-CBO-due-to/m-p/97598#M60769</link>
      <description>&lt;P&gt;the answer was given by &lt;A href="https://community.hortonworks.com/users/238/gbraccialli.html"&gt;Guilherme Braccialli&lt;/A&gt; .&lt;/P&gt;&lt;P&gt;in your /tmp/&amp;lt;user&amp;gt;/hive.log you would see a message like this  &lt;/P&gt;&lt;PRE&gt;2017-06-28 10:04:43,717 INFO  [main]: parse.BaseSemanticAnalyzer (CalcitePlanner.java:canCBOHandleAst(397)) - Not invoking CBO because the statement has too few joins

&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Jun 2017 21:01:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-Explain-says-quot-Plan-not-optimized-by-CBO-due-to/m-p/97598#M60769</guid>
      <dc:creator>aliyesami</dc:creator>
      <dc:date>2017-06-29T21:01:08Z</dc:date>
    </item>
  </channel>
</rss>

