Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into CUBRIDMAN-114_1
Browse files Browse the repository at this point in the history
  • Loading branch information
kisoo-han committed Jul 31, 2023
2 parents 8c2eb53 + c8b373a commit 4260128
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 33 deletions.
24 changes: 12 additions & 12 deletions en/sql/function/arithmetic_op.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,18 @@ The following table shows the total number of digits (*p*) and the number of dig

**Result of NUMERIC Type Operation**

+-----------------------+--------------------------------------------------------------------------------------------------------------------------+-------------------+
| Operation | Maximum Precision | Maximum Scale |
+=======================+==========================================================================================================================+===================+
| N(p1, s1) + N(p2, s2) | max(p1-s1, p2-s2)+max(s1, s2) +1 | max(s1, s2) |
+-----------------------+--------------------------------------------------------------------------------------------------------------------------+-------------------+
| N(p1, s1) - N(p2, s2) | max(p1-s1, p2-s2)+max(s1, s2) | max(s1, s2) |
+-----------------------+--------------------------------------------------------------------------------------------------------------------------+-------------------+
| N(p1, s1) * N(p2, s2) | p1+p2+1 | s1+s2 |
+-----------------------+--------------------------------------------------------------------------------------------------------------------------+-------------------+
| N(p1, s1) / N(p2, s2) | Let Pt = p1+max(s1, s2) + s2 - s1 when s2 > 0 and Pt = p1 in other cases; St = s1 when s1 > s2 and s2 in other cases; | |
| | the number of decimal places is min(9-St, 38-Pt) + St when St < 9 and St in other cases. | |
+-----------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
+-----------------------+---------------------------------------------+------------------------------------------------+
| Operation | Maximum Precision | Maximum Scale |
+=======================+=============================================+================================================+
| N(p1, s1) + N(p2, s2) | max(p1 - s1, p2 - s2) + max(s1, s2) + 1 | max(s1, s2) |
+-----------------------+---------------------------------------------+------------------------------------------------+
| N(p1, s1) - N(p2, s2) | max(p1 - s1, p2 - s2) + max(s1, s2) | max(s1, s2) |
+-----------------------+---------------------------------------------+------------------------------------------------+
| N(p1, s1) * N(p2, s2) | p1 + p2 + 1 | s1 + s2 |
+-----------------------+---------------------------------------------+------------------------------------------------+
| N(p1, s1) / N(p2, s2) | | Pt = (p1 - s1) + s2 + max(9, max(s1, s2)) | | St = max(9, max(s1, s2)) |
| | | Pt = (Pt > 38) ? 38 : Pt | | St = (Pt > 38) ? min(9, St - (Pt - 38)) : St |
+-----------------------+---------------------------------------------+------------------------------------------------+

**Example**

Expand Down
25 changes: 21 additions & 4 deletions en/sql/tuning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ Statistics for tables and indexes enables queries of the database system to proc

* **WITH FULLSCAN**: It updates the statistics with all the data in the specified table. If this is omitted, it updates the statistics with sampling data. The sampling data is 7 pages regardless of total pages of table.

.. note::

From 10.0 version, on the HA environment, **UPDATE STATISTICS** on the master node is replicated to the slave/replica node.

* **ALL CLASSES**: If the **ALL CLASSES** keyword is specified, the statistics on all the tables existing in the database are updated.

* **CATALOG CLASSES**: It updates the statistics of the catalog tables.
Expand Down Expand Up @@ -52,6 +48,27 @@ When starting and ending an update of statistics information, NOTIFICATION messa
Time: 05/07/13 15:06:25.053 - NOTIFICATION *** file ../../src/storage/statistics_sr.c, line 330 CODE = -1115 Tran = 1, CLIENT = testhost:csql(21060), EID = 5
Finished to update statistics (class "code", oid : 0|522|3, error code : 0).

.. note::

From version 10.0 of CUBRID, on the HA environment, **UPDATE STATISTICS** on the master node is replicated to the slave/replica node.

.. note::

From version 11.3 of CUBRID, synonyms cannot be used when executing **UPDATE STATISTICS** statement.

.. code-block:: sql
/* CURRENT_USER: PUBLIC */
CREATE TABLE t (c int);
CREATE SYNONYM s for t;
UPDATE STATISTICS ON t;
/* Execute OK. */
UPDATE STATISTICS ON s;
/* ERROR: before ' ; '
* Class public.s does not exist. */
.. _info-stats:

Checking Statistics Information
Expand Down
2 changes: 1 addition & 1 deletion ko/admin/migration.inc
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ CUBRID에서는 주석은 두 개의 연속된 하이픈(\-\-)을 이용하여
integer
**%id** 명령어에 의해 명시된 *class_name*\은 해당 데이터베이스에 정의된 클래스 이름이다. *class_name*\은 *schema_name*\을 접두사로 사용하며, *schema_name*\은 클래스가 정의된 스키마 이름이다.
*schema_name*\은 생략힐 수 있으며, *schema_name*\을 생략하면 -u 옵션과 함께 지정된 데이터베이스의 사용자 이름이 스키마 이름으로 사용된다.
*schema_name*\은 생략할 수 있으며, *schema_name*\을 생략하면 -u 옵션과 함께 지정된 데이터베이스의 사용자 이름이 스키마 이름으로 사용된다.
::
Expand Down
24 changes: 12 additions & 12 deletions ko/sql/function/arithmetic_op.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,18 @@

**NUMERIC 타입의 연산 결과**

+-----------------------+---------------------------------------------------------------------------------------------+---------------------------+
| 연산 | 결과의 최대 자릿수 | 결과의 소수점 이하 자릿수 |
+=======================+=============================================================================================+===========================+
| N(p1, s1) + N(p2, s2) | max(p1-s1, p2-s2)+max(s1, s2) +1 | max(s1, s2) |
+-----------------------+---------------------------------------------------------------------------------------------+---------------------------+
| N(p1, s1) - N(p2, s2) | max(p1-s1, p2-s2)+max(s1, s2) | max(s1, s2) |
+-----------------------+---------------------------------------------------------------------------------------------+---------------------------+
| N(p1, s1) * N(p2, s2) | p1+p2+1 | s1+s2 |
+-----------------------+---------------------------------------------------------------------------------------------+---------------------------+
| N(p1, s1) / N(p2, s2) | s2 > 0 이면 Pt = p1+max(s1, s2) + s2 - s1, 그 외에는 Pt = p1라 하고, s1 > s2 이면 St = s1, |
| | 그 외에는 s2라 하면, 소수점 이하 자릿수는 St < 9 이면 min(9-St, 38-Pt) + St, 그 외에는 St |
+-----------------------+---------------------------------------------------------------------------------------------+---------------------------+
+-----------------------+---------------------------------------------+------------------------------------------------+
| 연산 | 결과의 최대 자릿수 | 결과의 소수점 이하 자릿수 |
+=======================+=============================================+================================================+
| N(p1, s1) + N(p2, s2) | max(p1 - s1, p2 - s2) + max(s1, s2) + 1 | max(s1, s2) |
+-----------------------+---------------------------------------------+------------------------------------------------+
| N(p1, s1) - N(p2, s2) | max(p1 - s1, p2 - s2) + max(s1, s2) | max(s1, s2) |
+-----------------------+---------------------------------------------+------------------------------------------------+
| N(p1, s1) * N(p2, s2) | p1 + p2 + 1 | s1 + s2 |
+-----------------------+---------------------------------------------+------------------------------------------------+
| N(p1, s1) / N(p2, s2) | | Pt = (p1 - s1) + s2 + max(9, max(s1, s2)) | | St = max(9, max(s1, s2)) |
| | | Pt = (Pt > 38) ? 38 : Pt | | St = (Pt > 38) ? min(9, St - (Pt - 38)) : St |
+-----------------------+---------------------------------------------+------------------------------------------------+

**예제**

Expand Down
25 changes: 21 additions & 4 deletions ko/sql/tuning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@

* **WITH FULLSCAN**: 지정된 테이블의 전체 데이터를 가지고 통계 정보를 업데이트한다. 생략 시 샘플링한 데이터를 가지고 통계 정보를 업데이트한다. 데이터 샘플은 테이블 전체 페이지 수와 상관없이 7페이지이다.

.. note::

10.0 부터는 HA 환경의 마스터에서 수행한 **UPDATE STATISTICS** 문이 슬레이브/레플리카에 복제된다.

* **ALL CLASSES**: 모든 테이블의 통계 정보를 업데이트한다.

* **CATALOG CLASSES**: 카탈로그 테이블에 대한 통계 정보를 업데이트한다.
Expand Down Expand Up @@ -53,6 +49,27 @@
Time: 05/07/13 15:06:25.053 - NOTIFICATION *** file ../../src/storage/statistics_sr.c, line 330 CODE = -1115 Tran = 1, CLIENT = testhost:csql(21060), EID = 5
Finished to update statistics (class "code", oid : 0|522|3, error code : 0).

.. note::

CUBRID 10.0 부터는 HA 환경의 마스터에서 수행한 **UPDATE STATISTICS** 문이 슬레이브/레플리카에 복제된다.

.. note::

CUBRID 11.3부터는 **UPDATE STATISTICS** 문을 실행할 때 동의어를 사용할 수 없다.

.. code-block:: sql
/* CURRENT_USER: PUBLIC */
CREATE TABLE t (c int);
CREATE SYNONYM s for t;
UPDATE STATISTICS ON t;
/* Execute OK. */
UPDATE STATISTICS ON s;
/* ERROR: before ' ; '
* Class public.s does not exist. */
.. _info-stats:

통계 정보 확인
Expand Down

0 comments on commit 4260128

Please sign in to comment.