Skip to content

Commit

Permalink
Add docs for table statistics support in SQL Server connector
Browse files Browse the repository at this point in the history
  • Loading branch information
mosabua committed Apr 8, 2022
1 parent 6831f81 commit 3010045
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion docs/src/main/sphinx/connector/sqlserver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,50 @@ supports the following features:

.. include:: alter-table-limitation.fragment


Performance
-----------

The connector includes a number of performance improvements, detailed in the
following sections.

.. _sqlserver-table-statistics:

Table statistics
^^^^^^^^^^^^^^^^

The SQL Server connector can use :doc:`table and column statistics
</optimizer/statistics>` for :doc:`cost based optimizations
</optimizer/cost-based-optimizations>`, to improve query processing performance
based on the actual data in the data source.

The statistics are collected by SQL Server and retrieved by the connector.

The connector can use information stored in single-column statistics. SQL Server
Database can automatically create column statistics for certain columns. If
column statistics are not created automatically for a certain column, you can
create them by executing the following statement in SQL Server Database.

.. code-block:: sql
CREATE STATISTICS my_statistics_name ON table_schema.table_name (column_name);
SQL Server Database routinely updates the statistics. In some cases, you may
want to force statistics update (e.g. after defining new column statistics or
after changing data in the table). You can do that by executing the following
statement in SQL Server Database.

.. code-block:: sql
UPDATE STATISTICS table_schema.table_name;
Refer to SQL Server documentation for information about options, limitations and
additional considerations.

.. _sqlserver-pushdown:

Pushdown
--------
^^^^^^^^

The connector supports pushdown for a number of operations:

Expand Down

0 comments on commit 3010045

Please sign in to comment.