You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by sa...@apache.org on 2017/12/01 03:12:57 UTC

svn commit: r1816793 [2/2] - in /phoenix/site: publish/ publish/language/ source/src/site/ source/src/site/markdown/

Modified: phoenix/site/publish/sequences.html
URL: http://svn.apache.org/viewvc/phoenix/site/publish/sequences.html?rev=1816793&r1=1816792&r2=1816793&view=diff
==============================================================================
--- phoenix/site/publish/sequences.html (original)
+++ phoenix/site/publish/sequences.html Fri Dec  1 03:12:56 2017
@@ -1,7 +1,7 @@
 
 <!DOCTYPE html>
 <!--
- Generated by Apache Maven Doxia at 2017-10-12
+ Generated by Apache Maven Doxia at 2017-11-30
  Rendered using Reflow Maven Skin 1.1.0 (http://andriusvelykis.github.io/reflow-maven-skin)
 -->
 <html  xml:lang="en" lang="en">
@@ -139,6 +139,7 @@
 									<li class="active"><a href="" title="Sequences">Sequences</a></li>
 									<li ><a href="joins.html" title="Joins">Joins</a></li>
 									<li ><a href="subqueries.html" title="Subqueries">Subqueries</a></li>
+									<li ><a href="explainplan.html" title="Explain Plan">Explain Plan</a></li>
 								</ul>
 							</li>
 						</ul>
@@ -445,6 +446,9 @@ VALUES( NEXT VALUE FOR my_schema.my_sequ
 						<li >
 							<a href="subqueries.html" title="Subqueries">Subqueries</a>
 						</li>
+						<li >
+							<a href="explainplan.html" title="Explain Plan">Explain Plan</a>
+						</li>
 					</ul>
 				</div>
 				<div class="span3 bottom-description">

Modified: phoenix/site/publish/server.html
URL: http://svn.apache.org/viewvc/phoenix/site/publish/server.html?rev=1816793&r1=1816792&r2=1816793&view=diff
==============================================================================
--- phoenix/site/publish/server.html (original)
+++ phoenix/site/publish/server.html Fri Dec  1 03:12:56 2017
@@ -1,7 +1,7 @@
 
 <!DOCTYPE html>
 <!--
- Generated by Apache Maven Doxia at 2017-10-12
+ Generated by Apache Maven Doxia at 2017-11-30
  Rendered using Reflow Maven Skin 1.1.0 (http://andriusvelykis.github.io/reflow-maven-skin)
 -->
 <html  xml:lang="en" lang="en">
@@ -139,6 +139,7 @@
 									<li ><a href="sequences.html" title="Sequences">Sequences</a></li>
 									<li ><a href="joins.html" title="Joins">Joins</a></li>
 									<li ><a href="subqueries.html" title="Subqueries">Subqueries</a></li>
+									<li ><a href="explainplan.html" title="Explain Plan">Explain Plan</a></li>
 								</ul>
 							</li>
 						</ul>
@@ -693,6 +694,9 @@ log4j.logger.org.eclipse.jetty.server=IN
 						<li >
 							<a href="subqueries.html" title="Subqueries">Subqueries</a>
 						</li>
+						<li >
+							<a href="explainplan.html" title="Explain Plan">Explain Plan</a>
+						</li>
 					</ul>
 				</div>
 				<div class="span3 bottom-description">

Modified: phoenix/site/publish/skip_scan.html
URL: http://svn.apache.org/viewvc/phoenix/site/publish/skip_scan.html?rev=1816793&r1=1816792&r2=1816793&view=diff
==============================================================================
--- phoenix/site/publish/skip_scan.html (original)
+++ phoenix/site/publish/skip_scan.html Fri Dec  1 03:12:56 2017
@@ -1,7 +1,7 @@
 
 <!DOCTYPE html>
 <!--
- Generated by Apache Maven Doxia at 2017-10-12
+ Generated by Apache Maven Doxia at 2017-11-30
  Rendered using Reflow Maven Skin 1.1.0 (http://andriusvelykis.github.io/reflow-maven-skin)
 -->
 <html  xml:lang="en" lang="en">
@@ -139,6 +139,7 @@
 									<li ><a href="sequences.html" title="Sequences">Sequences</a></li>
 									<li ><a href="joins.html" title="Joins">Joins</a></li>
 									<li ><a href="subqueries.html" title="Subqueries">Subqueries</a></li>
+									<li ><a href="explainplan.html" title="Explain Plan">Explain Plan</a></li>
 								</ul>
 							</li>
 						</ul>
@@ -403,6 +404,9 @@ AND KEY2 IN (1, 2)
 						<li >
 							<a href="subqueries.html" title="Subqueries">Subqueries</a>
 						</li>
+						<li >
+							<a href="explainplan.html" title="Explain Plan">Explain Plan</a>
+						</li>
 					</ul>
 				</div>
 				<div class="span3 bottom-description">

Modified: phoenix/site/publish/source.html
URL: http://svn.apache.org/viewvc/phoenix/site/publish/source.html?rev=1816793&r1=1816792&r2=1816793&view=diff
==============================================================================
--- phoenix/site/publish/source.html (original)
+++ phoenix/site/publish/source.html Fri Dec  1 03:12:56 2017
@@ -1,7 +1,7 @@
 
 <!DOCTYPE html>
 <!--
- Generated by Apache Maven Doxia at 2017-10-12
+ Generated by Apache Maven Doxia at 2017-11-30
  Rendered using Reflow Maven Skin 1.1.0 (http://andriusvelykis.github.io/reflow-maven-skin)
 -->
 <html  xml:lang="en" lang="en">
@@ -139,6 +139,7 @@
 									<li ><a href="sequences.html" title="Sequences">Sequences</a></li>
 									<li ><a href="joins.html" title="Joins">Joins</a></li>
 									<li ><a href="subqueries.html" title="Subqueries">Subqueries</a></li>
+									<li ><a href="explainplan.html" title="Explain Plan">Explain Plan</a></li>
 								</ul>
 							</li>
 						</ul>
@@ -409,6 +410,9 @@
 						<li >
 							<a href="subqueries.html" title="Subqueries">Subqueries</a>
 						</li>
+						<li >
+							<a href="explainplan.html" title="Explain Plan">Explain Plan</a>
+						</li>
 					</ul>
 				</div>
 				<div class="span3 bottom-description">

Modified: phoenix/site/publish/subqueries.html
URL: http://svn.apache.org/viewvc/phoenix/site/publish/subqueries.html?rev=1816793&r1=1816792&r2=1816793&view=diff
==============================================================================
--- phoenix/site/publish/subqueries.html (original)
+++ phoenix/site/publish/subqueries.html Fri Dec  1 03:12:56 2017
@@ -1,7 +1,7 @@
 
 <!DOCTYPE html>
 <!--
- Generated by Apache Maven Doxia at 2017-10-12
+ Generated by Apache Maven Doxia at 2017-11-30
  Rendered using Reflow Maven Skin 1.1.0 (http://andriusvelykis.github.io/reflow-maven-skin)
 -->
 <html  xml:lang="en" lang="en">
@@ -139,6 +139,7 @@
 									<li ><a href="sequences.html" title="Sequences">Sequences</a></li>
 									<li ><a href="joins.html" title="Joins">Joins</a></li>
 									<li class="active"><a href="" title="Subqueries">Subqueries</a></li>
+									<li ><a href="explainplan.html" title="Explain Plan">Explain Plan</a></li>
 								</ul>
 							</li>
 						</ul>
@@ -547,6 +548,9 @@ ORDER BY count(*) DESC;
 						<li class="active">
 							<a href="#" title="Subqueries">Subqueries</a>
 						</li>
+						<li >
+							<a href="explainplan.html" title="Explain Plan">Explain Plan</a>
+						</li>
 					</ul>
 				</div>
 				<div class="span3 bottom-description">

Modified: phoenix/site/publish/tablesample.html
URL: http://svn.apache.org/viewvc/phoenix/site/publish/tablesample.html?rev=1816793&r1=1816792&r2=1816793&view=diff
==============================================================================
--- phoenix/site/publish/tablesample.html (original)
+++ phoenix/site/publish/tablesample.html Fri Dec  1 03:12:56 2017
@@ -1,7 +1,7 @@
 
 <!DOCTYPE html>
 <!--
- Generated by Apache Maven Doxia at 2017-10-12
+ Generated by Apache Maven Doxia at 2017-11-30
  Rendered using Reflow Maven Skin 1.1.0 (http://andriusvelykis.github.io/reflow-maven-skin)
 -->
 <html  xml:lang="en" lang="en">
@@ -139,6 +139,7 @@
 									<li ><a href="sequences.html" title="Sequences">Sequences</a></li>
 									<li ><a href="joins.html" title="Joins">Joins</a></li>
 									<li ><a href="subqueries.html" title="Subqueries">Subqueries</a></li>
+									<li ><a href="explainplan.html" title="Explain Plan">Explain Plan</a></li>
 								</ul>
 							</li>
 						</ul>
@@ -448,6 +449,9 @@ select count( * ) from (select NAME from
 						<li >
 							<a href="subqueries.html" title="Subqueries">Subqueries</a>
 						</li>
+						<li >
+							<a href="explainplan.html" title="Explain Plan">Explain Plan</a>
+						</li>
 					</ul>
 				</div>
 				<div class="span3 bottom-description">

Modified: phoenix/site/publish/team.html
URL: http://svn.apache.org/viewvc/phoenix/site/publish/team.html?rev=1816793&r1=1816792&r2=1816793&view=diff
==============================================================================
--- phoenix/site/publish/team.html (original)
+++ phoenix/site/publish/team.html Fri Dec  1 03:12:56 2017
@@ -1,7 +1,7 @@
 
 <!DOCTYPE html>
 <!--
- Generated by Apache Maven Doxia at 2017-10-12
+ Generated by Apache Maven Doxia at 2017-11-30
  Rendered using Reflow Maven Skin 1.1.0 (http://andriusvelykis.github.io/reflow-maven-skin)
 -->
 <html  xml:lang="en" lang="en">
@@ -139,6 +139,7 @@
 									<li ><a href="sequences.html" title="Sequences">Sequences</a></li>
 									<li ><a href="joins.html" title="Joins">Joins</a></li>
 									<li ><a href="subqueries.html" title="Subqueries">Subqueries</a></li>
+									<li ><a href="explainplan.html" title="Explain Plan">Explain Plan</a></li>
 								</ul>
 							</li>
 						</ul>
@@ -602,6 +603,9 @@
 						<li >
 							<a href="subqueries.html" title="Subqueries">Subqueries</a>
 						</li>
+						<li >
+							<a href="explainplan.html" title="Explain Plan">Explain Plan</a>
+						</li>
 					</ul>
 				</div>
 				<div class="span3 bottom-description">

Modified: phoenix/site/publish/tracing.html
URL: http://svn.apache.org/viewvc/phoenix/site/publish/tracing.html?rev=1816793&r1=1816792&r2=1816793&view=diff
==============================================================================
--- phoenix/site/publish/tracing.html (original)
+++ phoenix/site/publish/tracing.html Fri Dec  1 03:12:56 2017
@@ -1,7 +1,7 @@
 
 <!DOCTYPE html>
 <!--
- Generated by Apache Maven Doxia at 2017-10-12
+ Generated by Apache Maven Doxia at 2017-11-30
  Rendered using Reflow Maven Skin 1.1.0 (http://andriusvelykis.github.io/reflow-maven-skin)
 -->
 <html  xml:lang="en" lang="en">
@@ -139,6 +139,7 @@
 									<li ><a href="sequences.html" title="Sequences">Sequences</a></li>
 									<li ><a href="joins.html" title="Joins">Joins</a></li>
 									<li ><a href="subqueries.html" title="Subqueries">Subqueries</a></li>
+									<li ><a href="explainplan.html" title="Explain Plan">Explain Plan</a></li>
 								</ul>
 							</li>
 						</ul>
@@ -585,6 +586,9 @@ Connection conn = DriverManager.getConne
 						<li >
 							<a href="subqueries.html" title="Subqueries">Subqueries</a>
 						</li>
+						<li >
+							<a href="explainplan.html" title="Explain Plan">Explain Plan</a>
+						</li>
 					</ul>
 				</div>
 				<div class="span3 bottom-description">

Modified: phoenix/site/publish/transactions.html
URL: http://svn.apache.org/viewvc/phoenix/site/publish/transactions.html?rev=1816793&r1=1816792&r2=1816793&view=diff
==============================================================================
--- phoenix/site/publish/transactions.html (original)
+++ phoenix/site/publish/transactions.html Fri Dec  1 03:12:56 2017
@@ -1,7 +1,7 @@
 
 <!DOCTYPE html>
 <!--
- Generated by Apache Maven Doxia at 2017-10-12
+ Generated by Apache Maven Doxia at 2017-11-30
  Rendered using Reflow Maven Skin 1.1.0 (http://andriusvelykis.github.io/reflow-maven-skin)
 -->
 <html  xml:lang="en" lang="en">
@@ -139,6 +139,7 @@
 									<li ><a href="sequences.html" title="Sequences">Sequences</a></li>
 									<li ><a href="joins.html" title="Joins">Joins</a></li>
 									<li ><a href="subqueries.html" title="Subqueries">Subqueries</a></li>
+									<li ><a href="explainplan.html" title="Explain Plan">Explain Plan</a></li>
 								</ul>
 							</li>
 						</ul>
@@ -482,6 +483,9 @@ DELETE FROM my_other_table WHERE k=2;
 						<li >
 							<a href="subqueries.html" title="Subqueries">Subqueries</a>
 						</li>
+						<li >
+							<a href="explainplan.html" title="Explain Plan">Explain Plan</a>
+						</li>
 					</ul>
 				</div>
 				<div class="span3 bottom-description">

Modified: phoenix/site/publish/tuning.html
URL: http://svn.apache.org/viewvc/phoenix/site/publish/tuning.html?rev=1816793&r1=1816792&r2=1816793&view=diff
==============================================================================
--- phoenix/site/publish/tuning.html (original)
+++ phoenix/site/publish/tuning.html Fri Dec  1 03:12:56 2017
@@ -1,7 +1,7 @@
 
 <!DOCTYPE html>
 <!--
- Generated by Apache Maven Doxia at 2017-10-12
+ Generated by Apache Maven Doxia at 2017-11-30
  Rendered using Reflow Maven Skin 1.1.0 (http://andriusvelykis.github.io/reflow-maven-skin)
 -->
 <html  xml:lang="en" lang="en">
@@ -139,6 +139,7 @@
 									<li ><a href="sequences.html" title="Sequences">Sequences</a></li>
 									<li ><a href="joins.html" title="Joins">Joins</a></li>
 									<li ><a href="subqueries.html" title="Subqueries">Subqueries</a></li>
+									<li ><a href="explainplan.html" title="Explain Plan">Explain Plan</a></li>
 								</ul>
 							</li>
 						</ul>
@@ -656,6 +657,9 @@
 						<li >
 							<a href="subqueries.html" title="Subqueries">Subqueries</a>
 						</li>
+						<li >
+							<a href="explainplan.html" title="Explain Plan">Explain Plan</a>
+						</li>
 					</ul>
 				</div>
 				<div class="span3 bottom-description">

Modified: phoenix/site/publish/tuning_guide.html
URL: http://svn.apache.org/viewvc/phoenix/site/publish/tuning_guide.html?rev=1816793&r1=1816792&r2=1816793&view=diff
==============================================================================
--- phoenix/site/publish/tuning_guide.html (original)
+++ phoenix/site/publish/tuning_guide.html Fri Dec  1 03:12:56 2017
@@ -1,7 +1,7 @@
 
 <!DOCTYPE html>
 <!--
- Generated by Apache Maven Doxia at 2017-10-25
+ Generated by Apache Maven Doxia at 2017-11-30
  Rendered using Reflow Maven Skin 1.1.0 (http://andriusvelykis.github.io/reflow-maven-skin)
 -->
 <html  xml:lang="en" lang="en">
@@ -139,6 +139,7 @@
 									<li ><a href="sequences.html" title="Sequences">Sequences</a></li>
 									<li ><a href="joins.html" title="Joins">Joins</a></li>
 									<li ><a href="subqueries.html" title="Subqueries">Subqueries</a></li>
+									<li ><a href="explainplan.html" title="Explain Plan">Explain Plan</a></li>
 								</ul>
 							</li>
 						</ul>
@@ -357,63 +358,12 @@
  <h2 id="Deleting">Deleting</h2> 
  <p>When deleting a large data set, turn on autoCommit before issuing the <tt>DELETE</tt> query so that the client does not need to remember the row keys of all the keys as they are deleted. This prevents the client from buffering the rows affected by the <tt>DELETE</tt> so that Phoenix can delete them directly on the region servers without the expense of returning them to the client.</p> 
  <h1>Explain Plans</h1> 
- <p>An <tt>EXPLAIN</tt> plan tells you a lot about how a query will be run:</p> 
- <ul> 
-  <li>All the HBase range queries that will be executed</li> 
-  <li>The number of bytes that will be scanned</li> 
-  <li>The number of rows that will be traversed</li> 
-  <li>Which HBase table will be used for each scan</li> 
-  <li>Which operations (sort, merge, scan, limit) are executed on the client versus the server</li> 
- </ul> 
- <p>Use an <tt>EXPLAIN</tt> plan to check how a query will run, and consider rewriting queries to meet the following goals:</p> 
- <ul> 
-  <li>Emphasize operations on the server rather than the client. Server operations are distributed across the cluster and operate in parallel, while client operations execute within the single client JDBC driver.</li> 
-  <li>Use <tt>RANGE SCAN</tt> or <tt>SKIP SCAN</tt> whenever possible rather than <tt>TABLE SCAN</tt>.</li> 
-  <li>Filter against leading columns in the primary key constraint. This assumes you have designed the primary key to lead with frequently-accessed or frequently-filtered columns as described in “Primary Keys,” above.</li> 
-  <li>If necessary, introduce a local index or a global index that covers your query.</li> 
-  <li>If you have an index that covers your query but the optimizer is not detecting it, try hinting the query: <tt>SELECT /*+ INDEX() */ …</tt></li> 
- </ul> 
- <div class="section"> 
-  <h3 id="Anatomy_of_an_Explain_Plan">Anatomy of an Explain Plan</h3> 
-  <p>An explain plan consists of lines of text that describe operations that Phoenix will perform during a query, using the following terms:</p> 
-  <ul> 
-   <li><tt>AGGREGATE INTO ORDERED DISTINCT ROWS</tt>—aggregates the returned rows using an operation such as addition. When <tt>ORDERED</tt> is used, the <tt>GROUP BY</tt> operation is applied to the leading part of the primary key constraint, which allows the aggregation to be done in place rather than keeping all distinct groups in memory on the server side.</li> 
-   <li><tt>AGGREGATE INTO SINGLE ROW</tt>—aggregates the results into a single row using an aggregate function with no <tt>GROUP BY</tt> clause. For example, the <tt>count()</tt> statement returns one row with the total number of rows that match the query.</li> 
-   <li><tt>CLIENT</tt>—the operation will be performed on the client side. It’s faster to perform most operations on the server side, so you should consider whether there’s a way to rewrite the query to give the server more of the work to do.</li> 
-   <li><tt>FILTER BY</tt> expression—returns only results that match the expression.</li> 
-   <li><tt>FULL SCAN OVER</tt> tableName—the operation will scan every row in the specified table.</li> 
-   <li><tt>INNER-JOIN</tt>—the operation will join multiple tables on rows where the join condition is met.</li> 
-   <li><tt>MERGE SORT</tt>—performs a merge sort on the results.</li> 
-   <li><tt>RANGE SCAN OVER</tt> tableName <tt>[</tt> … <tt>]</tt>—The information in the square brackets indicates the start and stop for each primary key that’s used in the query.</li> 
-   <li><tt>ROUND ROBIN</tt>—when the query doesn’t contain <tt>ORDER BY</tt> and therefore the rows can be returned in any order, <tt>ROUND ROBIN</tt> order maximizes parallelization on the client side.</li> 
-   <li>x<tt>-CHUNK</tt>—describes how many threads will be used for the operation. The maximum parallelism is limited to the number of threads in thread pool. The minimum parallelization corresponds to the number of regions the table has between the start and stop rows of the scan. The number of chunks will increase with a lower guidepost width, as there is more than one chunk per region.</li> 
-   <li><tt>PARALLEL</tt>x-<tt>WAY</tt>—describes how many parallel scans will be merge sorted during the operation.</li> 
-   <li><tt>SERIAL</tt>—some queries run serially. For example, a single row lookup or a query that filters on the leading part of the primary key and limits the results below a configurable threshold.</li> 
-  </ul> 
- </div> 
- <div class="section"> 
-  <h3 id="Example">Example</h3> 
-  <div class="source"> 
-   <pre>+------------------------------------------+
-| PLAN |
-+------------------------------------------+
-| CLIENT 36-CHUNK PARALLEL 36-WAY FULL SCAN OVER exDocStoreb |
-|   PARALLEL INNER-JOIN TABLE 0 (SKIP MERGE) |
-|     CLIENT 36-CHUNK PARALLEL 36-WAY RANGE SCAN OVER indx_exdocb [0,' 42ecf4abd4bd7e7606025dc8eee3de 6a3cc04418cbc2619ddc01f54d88d7 c3bf'] - [0,' 42ecf4abd4bd7e7606025dc8eee3de 6a3cc04418cbc2619ddc01f54d88d7 c3bg' |
-|       SERVER FILTER BY FIRST KEY ONLY |
-|       SERVER AGGREGATE INTO ORDERED DISTINCT ROWS BY [&quot;ID&quot;] |
-|     CLIENT MERGE SORT |
-|   DYNAMIC SERVER FILTER BY (A.CURRENT_TIMESTAMP, [A.ID](http://a.id/)) IN ((TMP.MCT, TMP.TID)) |
-+-------------------------------------------+
-</pre> 
-  </div> 
-  <p>See also: <a class="externalLink" href="http://phoenix.apache.org/language/index.html#explain">http://phoenix.apache.org/language/index.html#explain</a></p> 
-  <h1>Improving parallelization</h1> 
-  <p>You can improve parallelization with the <a class="externalLink" href="https://phoenix.apache.org/update_statistics.html">UPDATE STATISTICS</a> command. This command subdivides each region by determining keys called <i>guideposts</i> that are equidistant from each other, then uses these guideposts to break up queries into multiple parallel scans. Statistics are turned on by default. With Phoenix 4.9, the user can set guidepost width for each table. Optimal guidepost width depends on a number of factors such as cluster size, cluster usage, number of cores per node, table size, and disk I/O.</p> 
-  <p>In Phoenix 4.12, we have added a new configuration <tt>phoenix.use.stats.parallelization</tt> that controls whether statistics should be used for driving parallelization. Note that one can still run stats collection. The information collected is used to surface estimates on number of bytes and rows a query will scan when an EXPLAIN is generated for it. </p> 
-  <h1>Further Tuning</h1> 
-  <p>For advice about tuning the underlying HBase and JVM layers, see <a class="externalLink" href="https://hbase.apache.org/book.html#schema.ops">Operational and Performance Configuration Options</a> in the Apache HBase™ Reference Guide.</p> 
- </div> 
+ <p>An <tt>EXPLAIN</tt> plan tells you a lot about how a query will be run. To generate explain plan look at this reference: <a class="externalLink" href="http://phoenix.apache.org/language/index.html#explain">http://phoenix.apache.org/language/index.html#explain</a>. For a more detailed explaination on how to interpret the explain plan and further use it for tuning queries go to: <a class="externalLink" href="http://phoenix.apache.org/explainplan.html">http://phoenix.apache.org/explainplan.html</a> </p> 
+ <h1>Improving parallelization</h1> 
+ <p>You can improve parallelization with the <a class="externalLink" href="https://phoenix.apache.org/update_statistics.html">UPDATE STATISTICS</a> command. This command subdivides each region by determining keys called <i>guideposts</i> that are equidistant from each other, then uses these guideposts to break up queries into multiple parallel scans. Statistics are turned on by default. With Phoenix 4.9, the user can set guidepost width for each table. Optimal guidepost width depends on a number of factors such as cluster size, cluster usage, number of cores per node, table size, and disk I/O.</p> 
+ <p>In Phoenix 4.12, we have added a new configuration <tt>phoenix.use.stats.parallelization</tt> that controls whether statistics should be used for driving parallelization. Note that one can still run stats collection. The information collected is used to surface estimates on number of bytes and rows a query will scan when an EXPLAIN is generated for it. </p> 
+ <h1>Further Tuning</h1> 
+ <p>For advice about tuning the underlying HBase and JVM layers, see <a class="externalLink" href="https://hbase.apache.org/book.html#schema.ops">Operational and Performance Configuration Options</a> in the Apache HBase™ Reference Guide.</p> 
 </div> 
 <div class="section"> 
  <h2 id="Special_Cases">Special Cases</h2> 
@@ -655,6 +605,9 @@
 						<li >
 							<a href="subqueries.html" title="Subqueries">Subqueries</a>
 						</li>
+						<li >
+							<a href="explainplan.html" title="Explain Plan">Explain Plan</a>
+						</li>
 					</ul>
 				</div>
 				<div class="span3 bottom-description">

Modified: phoenix/site/publish/udf.html
URL: http://svn.apache.org/viewvc/phoenix/site/publish/udf.html?rev=1816793&r1=1816792&r2=1816793&view=diff
==============================================================================
--- phoenix/site/publish/udf.html (original)
+++ phoenix/site/publish/udf.html Fri Dec  1 03:12:56 2017
@@ -1,7 +1,7 @@
 
 <!DOCTYPE html>
 <!--
- Generated by Apache Maven Doxia at 2017-10-12
+ Generated by Apache Maven Doxia at 2017-11-30
  Rendered using Reflow Maven Skin 1.1.0 (http://andriusvelykis.github.io/reflow-maven-skin)
 -->
 <html  xml:lang="en" lang="en">
@@ -139,6 +139,7 @@
 									<li ><a href="sequences.html" title="Sequences">Sequences</a></li>
 									<li ><a href="joins.html" title="Joins">Joins</a></li>
 									<li ><a href="subqueries.html" title="Subqueries">Subqueries</a></li>
+									<li ><a href="explainplan.html" title="Explain Plan">Explain Plan</a></li>
 								</ul>
 							</li>
 						</ul>
@@ -535,6 +536,9 @@ Connection conn = DriverManager.getConne
 						<li >
 							<a href="subqueries.html" title="Subqueries">Subqueries</a>
 						</li>
+						<li >
+							<a href="explainplan.html" title="Explain Plan">Explain Plan</a>
+						</li>
 					</ul>
 				</div>
 				<div class="span3 bottom-description">

Modified: phoenix/site/publish/update_statistics.html
URL: http://svn.apache.org/viewvc/phoenix/site/publish/update_statistics.html?rev=1816793&r1=1816792&r2=1816793&view=diff
==============================================================================
--- phoenix/site/publish/update_statistics.html (original)
+++ phoenix/site/publish/update_statistics.html Fri Dec  1 03:12:56 2017
@@ -1,7 +1,7 @@
 
 <!DOCTYPE html>
 <!--
- Generated by Apache Maven Doxia at 2017-10-25
+ Generated by Apache Maven Doxia at 2017-11-30
  Rendered using Reflow Maven Skin 1.1.0 (http://andriusvelykis.github.io/reflow-maven-skin)
 -->
 <html  xml:lang="en" lang="en">
@@ -139,6 +139,7 @@
 									<li ><a href="sequences.html" title="Sequences">Sequences</a></li>
 									<li ><a href="joins.html" title="Joins">Joins</a></li>
 									<li ><a href="subqueries.html" title="Subqueries">Subqueries</a></li>
+									<li ><a href="explainplan.html" title="Explain Plan">Explain Plan</a></li>
 								</ul>
 							</li>
 						</ul>
@@ -164,7 +165,6 @@
 </div> 
 <p>The UPDATE STATISTICS command updates the statistics collected on a table. This command collects a set of keys per region per column family that are equal byte distanced from each other. These collected keys are called <i>guideposts</i> and they act as <i>hints/guides</i> to improve the parallelization of queries on a given target region.</p> 
 <p>Statistics are also automatically collected during major compactions and region splits so manually running this command may not be necessary.</p> 
-<p>In 4.12, we have added a new configuration <tt>phoenix.use.stats.parallelization</tt> which controls whether statistical information on the data should be used to drive query parallelization (as described below). The default value of the configuration is true.</p> 
 <div class="section"> 
  <h2 id="Parallelization">Parallelization</h2> 
  <p>Phoenix breaks up queries into multiple scans and runs them in parallel to reduce latency. Parallelization in Phoenix is driven by the statistics related configuration parameters. Each chunk of data between guideposts will be run in parallel in a separate scan to improve query performance. The chunk size is determined by the GUIDE_POSTS_WIDTH table property (Phoenix 4.9 or above) or the global server-side <tt>phoenix.stats.guidepost.width</tt> parameter if the table property is not set. As the size of the chunks decrease, you’ll want to increase <tt>phoenix.query.queueSize</tt> as more work will be queued in that case. Note that at a minimum, separate scans will be run for each table region. Statistics in Phoenix provides a means of gaining intraregion parallelization. In addition to the guidepost width specification, the client-side <tt>phoenix.query.threadPoolSize</tt> and <tt>phoenix.query.queueSize</tt> parameters and the server-side <tt>hbase.regionserver.handler.count
 </tt> parameter have an impact on the amount of parallelization.</p> 
@@ -227,6 +227,11 @@
     <li>An advanced server-side parameter that if true causes the current time on the server-side to be used as the timestamp of rows in the statistics table when background tasks such as compactions or splits occur. If false, then the max timestamp found while traversing the table over which statistics are being collected is used as the timestamp. Unless your client is controlling the timestamps while reading and writing data, this parameter should be left alone.</li> 
     <li>The default value is true.</li> 
    </ul></li> 
+  <li><tt>phoenix.use.stats.parallelization</tt> 
+   <ul> 
+    <li>This configuration is available starting Phoenix 4.12. It controls whether statistical information on the data should be used to drive query parallelization.</li> 
+    <li>The default value is true.</li> 
+   </ul></li> 
  </ol> 
 </div>
 			</div>
@@ -457,6 +462,9 @@
 						<li >
 							<a href="subqueries.html" title="Subqueries">Subqueries</a>
 						</li>
+						<li >
+							<a href="explainplan.html" title="Explain Plan">Explain Plan</a>
+						</li>
 					</ul>
 				</div>
 				<div class="span3 bottom-description">
@@ -470,7 +478,7 @@
 		<div class="row">
 			<div class="span12">
 				<p class="pull-right"><a href="#">Back to top</a></p>
-				<p class="copyright">Copyright &copy;2013-2017 <a href="http://www.apache.org">Apache Software Foundation</a>. All Rights Reserved.</p>
+				<p class="copyright">Copyright &copy;2017 <a href="http://www.apache.org">Apache Software Foundation</a>. All Rights Reserved.</p>
 			</div>
 		</div>
 	</div>

Modified: phoenix/site/publish/upgrading.html
URL: http://svn.apache.org/viewvc/phoenix/site/publish/upgrading.html?rev=1816793&r1=1816792&r2=1816793&view=diff
==============================================================================
--- phoenix/site/publish/upgrading.html (original)
+++ phoenix/site/publish/upgrading.html Fri Dec  1 03:12:56 2017
@@ -1,7 +1,7 @@
 
 <!DOCTYPE html>
 <!--
- Generated by Apache Maven Doxia at 2017-10-12
+ Generated by Apache Maven Doxia at 2017-11-30
  Rendered using Reflow Maven Skin 1.1.0 (http://andriusvelykis.github.io/reflow-maven-skin)
 -->
 <html  xml:lang="en" lang="en">
@@ -139,6 +139,7 @@
 									<li ><a href="sequences.html" title="Sequences">Sequences</a></li>
 									<li ><a href="joins.html" title="Joins">Joins</a></li>
 									<li ><a href="subqueries.html" title="Subqueries">Subqueries</a></li>
+									<li ><a href="explainplan.html" title="Explain Plan">Explain Plan</a></li>
 								</ul>
 							</li>
 						</ul>
@@ -417,6 +418,9 @@
 						<li >
 							<a href="subqueries.html" title="Subqueries">Subqueries</a>
 						</li>
+						<li >
+							<a href="explainplan.html" title="Explain Plan">Explain Plan</a>
+						</li>
 					</ul>
 				</div>
 				<div class="span3 bottom-description">

Modified: phoenix/site/publish/views.html
URL: http://svn.apache.org/viewvc/phoenix/site/publish/views.html?rev=1816793&r1=1816792&r2=1816793&view=diff
==============================================================================
--- phoenix/site/publish/views.html (original)
+++ phoenix/site/publish/views.html Fri Dec  1 03:12:56 2017
@@ -1,7 +1,7 @@
 
 <!DOCTYPE html>
 <!--
- Generated by Apache Maven Doxia at 2017-10-12
+ Generated by Apache Maven Doxia at 2017-11-30
  Rendered using Reflow Maven Skin 1.1.0 (http://andriusvelykis.github.io/reflow-maven-skin)
 -->
 <html  xml:lang="en" lang="en">
@@ -139,6 +139,7 @@
 									<li ><a href="sequences.html" title="Sequences">Sequences</a></li>
 									<li ><a href="joins.html" title="Joins">Joins</a></li>
 									<li ><a href="subqueries.html" title="Subqueries">Subqueries</a></li>
+									<li ><a href="explainplan.html" title="Explain Plan">Explain Plan</a></li>
 								</ul>
 							</li>
 						</ul>
@@ -446,6 +447,9 @@ VALUES('John Doe', CURRENT_DATE(), NEXT
 						<li >
 							<a href="subqueries.html" title="Subqueries">Subqueries</a>
 						</li>
+						<li >
+							<a href="explainplan.html" title="Explain Plan">Explain Plan</a>
+						</li>
 					</ul>
 				</div>
 				<div class="span3 bottom-description">

Modified: phoenix/site/publish/who_is_using.html
URL: http://svn.apache.org/viewvc/phoenix/site/publish/who_is_using.html?rev=1816793&r1=1816792&r2=1816793&view=diff
==============================================================================
--- phoenix/site/publish/who_is_using.html (original)
+++ phoenix/site/publish/who_is_using.html Fri Dec  1 03:12:56 2017
@@ -1,7 +1,7 @@
 
 <!DOCTYPE html>
 <!--
- Generated by Apache Maven Doxia at 2017-10-12
+ Generated by Apache Maven Doxia at 2017-11-30
  Rendered using Reflow Maven Skin 1.1.0 (http://andriusvelykis.github.io/reflow-maven-skin)
 -->
 <html  xml:lang="en" lang="en">
@@ -139,6 +139,7 @@
 									<li ><a href="sequences.html" title="Sequences">Sequences</a></li>
 									<li ><a href="joins.html" title="Joins">Joins</a></li>
 									<li ><a href="subqueries.html" title="Subqueries">Subqueries</a></li>
+									<li ><a href="explainplan.html" title="Explain Plan">Explain Plan</a></li>
 								</ul>
 							</li>
 						</ul>
@@ -499,6 +500,9 @@
 						<li >
 							<a href="subqueries.html" title="Subqueries">Subqueries</a>
 						</li>
+						<li >
+							<a href="explainplan.html" title="Explain Plan">Explain Plan</a>
+						</li>
 					</ul>
 				</div>
 				<div class="span3 bottom-description">

Added: phoenix/site/source/src/site/markdown/explainplan.md
URL: http://svn.apache.org/viewvc/phoenix/site/source/src/site/markdown/explainplan.md?rev=1816793&view=auto
==============================================================================
--- phoenix/site/source/src/site/markdown/explainplan.md (added)
+++ phoenix/site/source/src/site/markdown/explainplan.md Fri Dec  1 03:12:56 2017
@@ -0,0 +1,89 @@
+# Explain Plans
+
+An `EXPLAIN` plan tells you a lot about how a query will be run:
+
+* All the HBase range queries that will be executed
+* An estimate of the number of bytes that will be scanned
+* An estimate of the number of rows that will be traversed
+* Time at which the above estimate information was collected
+* Which HBase table will be used for each scan
+* Which operations (sort, merge, scan, limit) are executed on the client versus the server
+
+Use an `EXPLAIN` plan to check how a query will run, and consider rewriting queries to meet the following goals:
+
+* Emphasize operations on the server rather than the client. Server operations are distributed across the cluster and operate in parallel, while client operations execute within the single client JDBC driver.
+* Use `RANGE SCAN` or `SKIP SCAN` whenever possible rather than `TABLE SCAN`.
+* Filter against leading columns in the primary key constraint.  This assumes you have designed the primary key to lead with frequently-accessed or frequently-filtered columns as described in “Primary Keys,” above.
+* If necessary, introduce a local index or a global index that covers your query.
+* If you have an index that covers your query but the optimizer is not detecting it, try hinting the query:
+    `SELECT /*+ INDEX() */ …`
+
+See also:
+http://phoenix.apache.org/language/index.html#explain
+
+### Anatomy of an Explain Plan
+
+An explain plan consists of lines of text that describe operations that Phoenix will perform during a query, using the following terms:
+
+* `AGGREGATE INTO ORDERED DISTINCT ROWS`—aggregates the returned rows using an operation such as addition. When `ORDERED` is used, the `GROUP BY` operation is applied to the leading part of the primary key constraint, which allows the aggregation to be done in place rather than keeping all distinct groups in memory on the server side.
+* `AGGREGATE INTO SINGLE ROW`—aggregates the results into a single row using an aggregate function with no `GROUP BY` clause. For example, the `count()` statement returns one row with the total number of rows that match the query.
+* `CLIENT`—the operation will be performed on the client side. It's faster to perform most operations on the server side, so you should consider whether there's a way to rewrite the query to give the server more of the work to do.
+* `FILTER BY` expression—returns only results that match the expression.
+* `FULL SCAN OVER` tableName—the operation will scan every row in the specified table.
+* `INNER-JOIN`—the operation will join multiple tables on rows where the join condition is met.
+* `MERGE SORT`—performs a merge sort on the results.
+* `RANGE SCAN OVER` tableName `[` ... `]`—The information in the square brackets indicates the start and stop for each primary key that's used in the query.
+* `ROUND ROBIN`—when the query doesn't contain `ORDER BY` and therefore the rows can be returned in any order, `ROUND ROBIN` order maximizes parallelization on the client side.
+* x`-CHUNK`—describes how many threads will be used for the operation. The maximum parallelism is limited to the number of threads in thread pool. The minimum parallelization corresponds to the number of regions the table has between the start and stop rows of the scan. The number of chunks will increase with a lower guidepost width, as there is more than one chunk per region.
+* `PARALLEL `x-`WAY`—describes how many parallel scans will be merge sorted during the operation.
+* `SERIAL`—some queries run serially. For example, a single row lookup or a query that filters on the leading part of the primary key and limits the results below a configurable threshold.
+* `EST_BYTES_READ` - provides an estimate of the total number of bytes that will be scanned as part of executing the query
+* `EST_ROWS_READ` - provides an estimate of the total number of rows that will be scanned as part of executing the query
+* `EST_INFO_TS` - epoch time in milliseconds at which the estimate information was collected
+ 
+### Example
+
+```
+
++-----------------------------------------------------------------------------------------------------------------------------------
+|                                            PLAN                                 | EST_BYTES_READ  | EST_ROWS_READ  | EST_INFO_TS  |
++-----------------------------------------------------------------------------------------------------------------------------------
+| CLIENT 36-CHUNK 237878 ROWS 6787437019 BYTES PARALLEL 36-WAY FULL SCAN
+| OVER exDocStoreb                                                                |     237878      |   6787437019   | 1510353318102|
+|   PARALLEL INNER-JOIN TABLE 0 (SKIP MERGE)                                      |     237878      |   6787437019   | 1510353318102|
+|     CLIENT 36-CHUNK PARALLEL 36-WAY RANGE SCAN OVER indx_exdocb 
+|      [0,' 42ecf4abd4bd7e7606025dc8eee3de 6a3cc04418cbc2619ddc01f54d88d7 c3bf'] 
+|      - [0,' 42ecf4abd4bd7e7606025dc8eee3de 6a3cc04418cbc2619ddc01f54d88d7 c3bg' |     237878      |   6787437019   | 1510353318102|
+|       SERVER FILTER BY FIRST KEY ONLY                                           |     237878      |   6787437019   | 1510353318102|
+|       SERVER AGGREGATE INTO ORDERED DISTINCT ROWS BY ["ID"]                     |     237878      |   6787437019   | 1510353318102|
+|     CLIENT MERGE SORT                                                           |     237878      |   6787437019   | 1510353318102|
+|   DYNAMIC SERVER FILTER BY (A.CURRENT_TIMESTAMP, [A.ID](http://a.id/)) 
+    IN ((TMP.MCT, TMP.TID))                                                       |     237878      |   6787437019   | 1510353318102|
++-----------------------------------------------------------------------------------------------------------------------------------
+```
+
+### JDBC Explain Plan API and the estimates information
+
+The information displayed in the explain plan API can also be accessed programmatically through the standard JDBC interfaces. When statistics collection
+is enabled for a table, the explain plan also gives an estimate of number of rows and bytes a query is going to scan. To get hold of the info, you can
+use corresponding columns in the result set returned by the explain plan statement. When stats collection is not enabled or if for some reason
+Phoenix cannot provide the estimate information, the columns return null. Below is an example:
+
+```
+String explainSql = "EXPLAIN SELECT * FROM T";
+Long estimatedBytes = null;
+Long estimatedRows = null;
+Long estimateInfoTs = null;
+try (Statement statement = conn.createStatement(explainSql)) {
+        int paramIdx = 1;
+        ResultSet rs = statement.executeQuery(explainSql);
+        rs.next();
+        estimatedBytes =
+                (Long) rs.getObject(PhoenixRuntime.EXPLAIN_PLAN_ESTIMATED_BYTES_READ_COLUMN);
+        estimatedRows =
+                (Long) rs.getObject(PhoenixRuntime.EXPLAIN_PLAN_ESTIMATED_ROWS_READ_COLUMN);
+        estimateInfoTs =
+                (Long) rs.getObject(PhoenixRuntime.EXPLAIN_PLAN_ESTIMATE_INFO_TS_COLUMN);
+}
+```
+

Modified: phoenix/site/source/src/site/markdown/tuning_guide.md
URL: http://svn.apache.org/viewvc/phoenix/site/source/src/site/markdown/tuning_guide.md?rev=1816793&r1=1816792&r2=1816793&view=diff
==============================================================================
--- phoenix/site/source/src/site/markdown/tuning_guide.md (original)
+++ phoenix/site/source/src/site/markdown/tuning_guide.md Fri Dec  1 03:12:56 2017
@@ -217,58 +217,8 @@ When deleting a large data set, turn on
 
 # Explain Plans
 
-An `EXPLAIN` plan tells you a lot about how a query will be run:
+An `EXPLAIN` plan tells you a lot about how a query will be run. To generate explain plan look at this reference: http://phoenix.apache.org/language/index.html#explain. For a more detailed explaination on how to interpret the explain plan and further use it for tuning queries go to: http://phoenix.apache.org/explainplan.html 
 
-* All the HBase range queries that will be executed
-* The number of bytes that will be scanned
-* The number of rows that will be traversed
-* Which HBase table will be used for each scan
-* Which operations (sort, merge, scan, limit) are executed on the client versus the server 
-
-Use an `EXPLAIN` plan to check how a query will run, and consider rewriting queries to meet the following goals:
-
-* Emphasize operations on the server rather than the client. Server operations are distributed across the cluster and operate in parallel, while client operations execute within the single client JDBC driver.
-* Use `RANGE SCAN` or `SKIP SCAN` whenever possible rather than `TABLE SCAN`.
-* Filter against leading columns in the primary key constraint.  This assumes you have designed the primary key to lead with frequently-accessed or frequently-filtered columns as described in “Primary Keys,” above.
-* If necessary, introduce a local index or a global index that covers your query.
-* If you have an index that covers your query but the optimizer is not detecting it, try hinting the query:
-    `SELECT /*+ INDEX() */ …`
-
-### Anatomy of an Explain Plan
-
-An explain plan consists of lines of text that describe operations that Phoenix will perform during a query, using the following terms:
-
-* `AGGREGATE INTO ORDERED DISTINCT ROWS`—aggregates the returned rows using an operation such as addition. When `ORDERED` is used, the `GROUP BY` operation is applied to the leading part of the primary key constraint, which allows the aggregation to be done in place rather than keeping all distinct groups in memory on the server side.
-* `AGGREGATE INTO SINGLE ROW`—aggregates the results into a single row using an aggregate function with no `GROUP BY` clause. For example, the `count()` statement returns one row with the total number of rows that match the query.
-* `CLIENT`—the operation will be performed on the client side. It's faster to perform most operations on the server side, so you should consider whether there's a way to rewrite the query to give the server more of the work to do. 
-* `FILTER BY` expression—returns only results that match the expression.
-* `FULL SCAN OVER` tableName—the operation will scan every row in the specified table. 
-* `INNER-JOIN`—the operation will join multiple tables on rows where the join condition is met.
-* `MERGE SORT`—performs a merge sort on the results.
-* `RANGE SCAN OVER` tableName `[` ... `]`—The information in the square brackets indicates the start and stop for each primary key that's used in the query.
-* `ROUND ROBIN`—when the query doesn't contain `ORDER BY` and therefore the rows can be returned in any order, `ROUND ROBIN` order maximizes parallelization on the client side.
-* x`-CHUNK`—describes how many threads will be used for the operation. The maximum parallelism is limited to the number of threads in thread pool. The minimum parallelization corresponds to the number of regions the table has between the start and stop rows of the scan. The number of chunks will increase with a lower guidepost width, as there is more than one chunk per region.
-* `PARALLEL `x-`WAY`—describes how many parallel scans will be merge sorted during the operation.
-* `SERIAL`—some queries run serially. For example, a single row lookup or a query that filters on the leading part of the primary key and limits the results below a configurable threshold.
-
-### Example
-
-```
-+------------------------------------------+
-| PLAN |
-+------------------------------------------+
-| CLIENT 36-CHUNK PARALLEL 36-WAY FULL SCAN OVER exDocStoreb |
-|   PARALLEL INNER-JOIN TABLE 0 (SKIP MERGE) |
-|     CLIENT 36-CHUNK PARALLEL 36-WAY RANGE SCAN OVER indx_exdocb [0,' 42ecf4abd4bd7e7606025dc8eee3de 6a3cc04418cbc2619ddc01f54d88d7 c3bf'] - [0,' 42ecf4abd4bd7e7606025dc8eee3de 6a3cc04418cbc2619ddc01f54d88d7 c3bg' |
-|       SERVER FILTER BY FIRST KEY ONLY |
-|       SERVER AGGREGATE INTO ORDERED DISTINCT ROWS BY ["ID"] |
-|     CLIENT MERGE SORT |
-|   DYNAMIC SERVER FILTER BY (A.CURRENT_TIMESTAMP, [A.ID](http://a.id/)) IN ((TMP.MCT, TMP.TID)) |
-+-------------------------------------------+
-```
-
-See also:
-http://phoenix.apache.org/language/index.html#explain
 
 # Improving parallelization
 

Modified: phoenix/site/source/src/site/markdown/update_statistics.md
URL: http://svn.apache.org/viewvc/phoenix/site/source/src/site/markdown/update_statistics.md?rev=1816793&r1=1816792&r2=1816793&view=diff
==============================================================================
--- phoenix/site/source/src/site/markdown/update_statistics.md (original)
+++ phoenix/site/source/src/site/markdown/update_statistics.md Fri Dec  1 03:12:56 2017
@@ -9,10 +9,6 @@ target region.
 Statistics are also automatically collected during major compactions and region splits so
 manually running this command may not be necessary.
 
-In 4.12, we have added a new configuration <code>phoenix.use.stats.parallelization</code>
-which controls whether statistical information on the data should be used to drive
-query parallelization (as described below). The default value of the configuration is true.
-
 
 ##Parallelization
 Phoenix breaks up queries into multiple scans and runs them in parallel to reduce latency.
@@ -83,3 +79,7 @@ The configuration parameters controlling
       client is controlling the timestamps while reading and writing data, this parameter
       should be left alone.
     * The default value is true.
+5. <code>phoenix.use.stats.parallelization</code>
+    * This configuration is available starting Phoenix 4.12. It controls whether statistical information 
+      on the data should be used to drive query parallelization.
+    * The default value is true.

Modified: phoenix/site/source/src/site/site.xml
URL: http://svn.apache.org/viewvc/phoenix/site/source/src/site/site.xml?rev=1816793&r1=1816792&r2=1816793&view=diff
==============================================================================
--- phoenix/site/source/src/site/site.xml (original)
+++ phoenix/site/source/src/site/site.xml Fri Dec  1 03:12:56 2017
@@ -132,6 +132,7 @@
             <item href="sequences.html" name="Sequences"/>
             <item href="joins.html" name="Joins"/>
             <item href="subqueries.html" name="Subqueries"/>
+            <item href="explainplan.html" name="Explain Plan"/>
         </menu>
 
     </body>