Skip to content

Commit

Permalink
Add histogram statistic documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ZacBlanco committed Apr 23, 2024
1 parent 22e0391 commit bac6b3f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
11 changes: 11 additions & 0 deletions presto-docs/src/main/sphinx/admin/properties.rst
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,17 @@ Optimizer Properties
Enable analysis and propagation of logical properties like distinct keys or cardinality among the nodes of
a query plan. The optimizer may then use these properties to perform various optimizations.

``optimizer.use-histograms``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

* **Type:** ``boolean``
* **Default Value:** ``false``

Enables the optimizer uses histograms when available to perform the cost estimate calculations
during query optimization. This parameter does not prevent histograms from being collected by
``ANALYZE``, but rather prevents them from being used during query optimization. This behavior
can be controlled on a per-query basis using the ``optimizer_use_histograms`` session property.

Planner Properties
------------------

Expand Down
7 changes: 4 additions & 3 deletions presto-docs/src/main/sphinx/optimizer/statistics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Presto supports statistics based optimizations for queries. For a query to take
advantage of these optimizations, Presto must have statistical information for
the tables in that query.

Table statistics are provided to the query planner by connectors. Currently, the
only connector that supports statistics is the :doc:`/connector/hive`.
Table statistics are provided to the query planner by connectors. Support for
statistics is dependent upon the connector.

Table Layouts
-------------
Expand Down Expand Up @@ -41,12 +41,13 @@ The following statistics are available in Presto:
* **distinct value count**: the number of distinct values
* **low value**: the smallest value in the column
* **high value**: the largest value in the column
* **histogram**: A connector-dependent histogram data structure.

The set of statistics available for a particular query depends on the connector
being used and can also vary by table or even by table layout. For example, the
Hive connector does not currently provide statistics on data size.

Table statistics can be displayed via the Presto SQL interface using the
Table statistics can be displayed via a SQL statement using the
:doc:`/sql/show-stats` command. For the Hive connector, refer to the
:ref:`Hive connector <hive_analyze>` documentation to learn how to update table
statistics.

0 comments on commit bac6b3f

Please sign in to comment.