Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CUBRIDMAN-224] Manual for correlated subquery result cache #526

Merged
merged 71 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
eb9d411
add subquerycache related texts
xmilex-git Jun 13, 2024
1bc152f
add example
xmilex-git Jun 20, 2024
c691256
add english ver
xmilex-git Jun 20, 2024
e6f1925
vscode fix
xmilex-git Jun 20, 2024
6f9fe61
update english
xmilex-git Jun 20, 2024
ac47dd5
add blank line
xmilex-git Jun 20, 2024
2b350fa
move to alphabetical loc
xmilex-git Jun 20, 2024
65d5067
apply code review(1)
xmilex-git Jun 20, 2024
b40818b
Update ko/sql/tuning.rst
xmilex-git Jun 21, 2024
53ee79b
add examples
xmilex-git Jun 21, 2024
999b822
Update en/sql/tuning.rst
xmilex-git Jun 21, 2024
c419e5a
Update en/sql/tuning.rst
xmilex-git Jun 21, 2024
f9f62f5
Update en/sql/tuning.rst
xmilex-git Jun 21, 2024
b410a8c
apply code review (2)
xmilex-git Jun 21, 2024
5286bc7
apply code review (leading hint)
xmilex-git Jun 28, 2024
cfb8c2f
add connect by
xmilex-git Jul 18, 2024
38b4006
Update en/sql/tuning.rst
xmilex-git Aug 2, 2024
b1e29ef
Update ko/admin/config.rst
xmilex-git Aug 2, 2024
2174934
Update ko/sql/tuning.rst
xmilex-git Aug 2, 2024
2619430
Update en/sql/tuning.rst
xmilex-git Aug 2, 2024
f3cf032
Update ko/sql/tuning.rst
xmilex-git Aug 2, 2024
10d1fe0
Update ko/sql/tuning.rst
xmilex-git Aug 2, 2024
0344207
Update ko/sql/tuning.rst
xmilex-git Aug 2, 2024
7285854
Update en/sql/tuning.rst
xmilex-git Aug 2, 2024
4758dee
Update en/sql/tuning.rst
xmilex-git Aug 2, 2024
20b0ed4
Update ko/admin/config.rst
xmilex-git Aug 2, 2024
ad256ca
Update en/admin/config.rst
xmilex-git Aug 2, 2024
4f742e6
Update ko/sql/tuning.rst
xmilex-git Aug 2, 2024
466297a
Update ko/sql/tuning.rst
xmilex-git Aug 2, 2024
51e3b3e
Update ko/sql/tuning.rst
xmilex-git Aug 2, 2024
740ffd7
Update en/admin/config.rst
xmilex-git Aug 2, 2024
a671d83
Update ko/admin/config.rst
xmilex-git Aug 2, 2024
2e98753
Update ko/sql/tuning.rst
xmilex-git Aug 2, 2024
b85b56c
Update ko/sql/tuning.rst
xmilex-git Aug 2, 2024
951ab7b
Update ko/sql/tuning.rst
xmilex-git Aug 2, 2024
30d7584
Update en/sql/tuning.rst
xmilex-git Aug 2, 2024
0f15d76
Update en/sql/tuning.rst
xmilex-git Aug 2, 2024
0c57ec6
Update en/sql/tuning.rst
xmilex-git Aug 2, 2024
9cb1bfb
applying code review
xmilex-git Aug 7, 2024
ac62556
단위 설명
xmilex-git Aug 7, 2024
2667a5e
문맥 조정
xmilex-git Aug 7, 2024
57d2642
순서 조정
xmilex-git Aug 7, 2024
722a825
apply code review
xmilex-git Aug 8, 2024
1f6c14a
Update ko/sql/tuning.rst
xmilex-git Aug 8, 2024
20f38cb
Update ko/sql/tuning.rst
xmilex-git Aug 8, 2024
c2f7c50
Update ko/sql/tuning.rst
xmilex-git Aug 8, 2024
b555a30
Update ko/sql/tuning.rst
xmilex-git Aug 8, 2024
09506ee
Update ko/sql/tuning.rst
xmilex-git Aug 8, 2024
927f4b6
Update ko/sql/tuning.rst
xmilex-git Aug 8, 2024
c6f5d3d
Update ko/sql/tuning.rst
xmilex-git Aug 8, 2024
6db90ff
Update ko/sql/tuning.rst
xmilex-git Aug 8, 2024
af28b8d
Update ko/sql/tuning.rst
xmilex-git Aug 8, 2024
faca4dc
Update ko/sql/tuning.rst
xmilex-git Aug 8, 2024
8edf01b
Update ko/sql/tuning.rst
xmilex-git Aug 8, 2024
8d2c092
Update ko/sql/tuning.rst
xmilex-git Aug 8, 2024
2c72cfd
apply code review (2)
xmilex-git Aug 8, 2024
058e25d
코드 리뷰 영문 적용
xmilex-git Aug 8, 2024
93e1634
Update ko/sql/tuning.rst
xmilex-git Aug 8, 2024
61acafa
Update ko/sql/tuning.rst
xmilex-git Aug 8, 2024
e56c955
Update ko/sql/tuning.rst
xmilex-git Aug 8, 2024
f397238
코드리뷰 영문적용
xmilex-git Aug 8, 2024
359594a
Merge branch 'CUBRID:develop' into CUBRIDMAN-224
xmilex-git Aug 8, 2024
74cd8cd
Update en/admin/config.rst
xmilex-git Aug 9, 2024
3164386
Update en/sql/tuning.rst
xmilex-git Aug 9, 2024
6d577e7
Update en/sql/tuning.rst
xmilex-git Aug 9, 2024
f6cddc3
Update ko/sql/tuning.rst
xmilex-git Aug 9, 2024
7f78de2
Apply suggestions from code review
xmilex-git Aug 9, 2024
33eadb8
Apply suggestions from code review
xmilex-git Aug 9, 2024
c6f0c49
질의 프로파일링 관련 링크 추가
xmilex-git Aug 9, 2024
c000bee
Apply suggestions from code review
xmilex-git Aug 9, 2024
fdd8714
Apply suggestions from code review
xmilex-git Aug 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions en/admin/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@

.. note:: If you want to change the value of a parameter permanently, restart all of DB server and broker after changing configuration values of cubrid.conf.

+-------------------------------+-------------------------------------+-------------------------+---------+----------+--------------------------------+-----------------------+

Check warning on line 120 in en/admin/config.rst

View workflow job for this annotation

GitHub Actions / build_docs (en)

Malformed table.
| Category | Parameter Name | Applied | Session | Type | Default Value | Dynamic Change |
+===============================+=====================================+=========================+=========+==========+================================+=======================+
| :ref:`connection-parameters` | cubrid_port_id | client parameter | | int | 1,523 | |
Expand Down Expand Up @@ -148,6 +148,8 @@
| | temp_file_memory_size_in_pages | server parameter | | int | 4 | |
| +-------------------------------------+-------------------------+---------+----------+--------------------------------+-----------------------+
| | thread_stacksize | server parameter | | byte | 1,048,576 | |
| +-------------------------------------+-------------------------+---------+----------+--------------------------------+-----------------------+
| | max_subquery_cache_size | 서버 | | byte | 2,097,152(2M) | |
+-------------------------------+-------------------------------------+-------------------------+---------+----------+--------------------------------+-----------------------+
| :ref:`disk-parameters` | db_volume_size | server parameter | | byte | 512M | |
| +-------------------------------------+-------------------------+---------+----------+--------------------------------+-----------------------+
Expand Down Expand Up @@ -683,6 +685,8 @@
+--------------------------------+--------+---------------------------+---------------------------+---------------------------+
| thread_stacksize | byte | 1,048,576 | 65,536 | |
+--------------------------------+--------+---------------------------+---------------------------+---------------------------+
| max_subquery_cache_size | byte | 2,097,152(2M) | 0 | 16,777,216(16M) |
xmilex-git marked this conversation as resolved.
Show resolved Hide resolved
+--------------------------------+--------+---------------------------+---------------------------+---------------------------+

**data_buffer_size**

Expand Down Expand Up @@ -740,6 +744,12 @@

**thread_stacksize** is a parameter to configure the stack size of a thread. The default value is **1048576** bytes. The value of the **thread_stacksize** parameter must not exceed the stack size allowed by the operating system.

**max_subquery_cache_size**

**max_subquery_cache_size** is a parameter to configure the size of subquery cache (correlated).
The default value is **2097152** bytes.
If there is insufficient storage space, no further subquery caching will be possible.
xmilex-git marked this conversation as resolved.
Show resolved Hide resolved

.. _disk-parameters:

Disk-Related Parameters
Expand Down
78 changes: 78 additions & 0 deletions en/sql/tuning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@
NO_COVERING_IDX |
NO_MULTI_RANGE_OPT |
NO_SORT_LIMIT |
NO_SUBQUERY_CACHE |
NO_PUSH_PRED |
NO_MERGE |
NO_ELIMINATE_JOIN |
Expand Down Expand Up @@ -724,6 +725,7 @@
* **NO_COVERING_IDX**: This is a hint not to use the covering index. For details, see :ref:`covering-index`.
* **NO_MULTI_RANGE_OPT**: This is a hint not to use the multi-key range optimization. For details, see :ref:`multi-key-range-opt`.
* **NO_SORT_LIMIT**: This is a hint not to use the SORT-LIMIT optimization. For more details, see :ref:`sort-limit-optimization`.
* **NO_SUBQUERY_CACHE**: SUBQUERY_CACHE 최적화를 사용하지 않기 위한 힌트이다.
xmilex-git marked this conversation as resolved.
Show resolved Hide resolved
* **NO_PUSH_PRED**: This is a hint not to use the PREDICATE-PUSH optimization.
* **NO_MERGE**: This is a hint not to use the VIEW-MERGE optimization.
* **NO_ELIMINATE_JOIN**: This is a hint not to use join elimination optimization. For more details, see :ref:`join-elimination-optimization`.
Expand Down Expand Up @@ -4189,3 +4191,79 @@
}

The cached query is shown as **query_string** in the middle of the result screen. Each of the **n_entries** and **n_pages** represents the number of cached queries and the number of pages in the cached results. The **n_entries** is limited to the value of configuration parameter **max_query_cache_entries** and the **n_pages** is limited to the value of **query_cache_size_in_pages**. If the **n_entries** is overflown or the **n_pages** is overflown, some victims among the cache entries are selected and they are uncached. The number of victims is about 20% of **max_query_cache_entries** value and of the **query_cache_size_in_pages** value.

.. _subquery-cache:

SUBQUERY CACHE (correlated)
------------------------------------

Subquery cache optimization can be used to enhance the performance of queries containing correlated subqueries, and the results of the subqueries are cached in independent spaces for each subquery.
To disable subquery cache optimization, use the NO_SUBQUERY_CACHE hint on the target subquery.

Subquery cache does not operate in the following scenarios:
xmilex-git marked this conversation as resolved.
Show resolved Hide resolved

* When the correlated subquery contains another correlated subquery.
* When the subquery is not in the SELECT clause.
* When the subquery uses CUBRID extended APIs related to classes.
* When the subquery includes the NO_SUBQUERY_CACHE hint.
* When storing new results exceeds the set subquery cache size (default: 2MB).
xmilex-git marked this conversation as resolved.
Show resolved Hide resolved
* When the subquery contains functions that change results with each execution, such as random() or sys_guid().
When a correlated subquery is in the SELECT clause, the subquery cache is used.

Check warning on line 4211 in en/sql/tuning.rst

View workflow job for this annotation

GitHub Actions / build_docs (en)

Bullet list ends without a blank line; unexpected unindent.
Among the repeatedly executed correlated subqueries, if the column value of the main query referenced by the correlated subquery is the same, the cached result is used to prevent re-execution.
If the cached query cannot be found, the subquery is processed, and the column value and query result are cached together.
If the same column value is found in the cache, the result is retrieved from the cached area.
In CSQL, as shown in the example below, the improved performance can be easily measured when repeatedly executing queries using the COUNT function.
The result for the first query's subquery is slow because it is not cached, but the result for the second query's subquery is fetched from the cached area, making the response time much faster than the previous query. ::

csql> SELECT count(*) from (
SELECT /*+ recompile no_merge */
(SELECT /*+ NO_SUBQUERY_CACHE */ t1_pk FROM t1 b WHERE b.t1_pk = a.c3)
FROM
t1 a
WHERE a.c2 >= 1);
xmilex-git marked this conversation as resolved.
Show resolved Hide resolved
=== <Result of SELECT Command in Line 2> ===

count(*)
======================
99000

1 row selected. (0.626199 sec) Committed. (0.000011 sec)

1 command(s) successfully processed.

Trace Statistics:
SELECT (time: 621, fetch: 397811, fetch_time: 56, ioread: 0)
SCAN (temp time: 7, fetch: 142, ioread: 0, readrows: 99000, rows: 99000)
SUBQUERY (uncorrelated)
SELECT (time: 607, fetch: 397669, fetch_time: 56, ioread: 0)
SCAN (table: dba.t1), (heap time: 98, fetch: 100384, ioread: 0, readrows: 100000, rows: 99000)
SUBQUERY (correlated)
SELECT (time: 460, fetch: 297000, fetch_time: 0, ioread: 0)
SCAN (index: dba.t1.pk_t1), (btree time: 243, fetch: 198000, ioread: 0, readkeys: 99000, filteredkeys: 0, rows: 99000, covered: true)

csql> SELECT count(*) from (
SELECT /*+ recompile no_merge */
(SELECT t1_pk FROM t1 b WHERE b.t1_pk = a.c3)
FROM
t1 a
WHERE a.c2 >= 1);
xmilex-git marked this conversation as resolved.
Show resolved Hide resolved
=== <Result of SELECT Command in Line 6> ===

count(*)
======================
99000

1 row selected. (0.128251 sec) Committed. (0.000010 sec)

1 command(s) successfully processed.

Trace Statistics:
SELECT (time: 122, fetch: 103781, fetch_time: 13, ioread: 0)
SCAN (temp time: 7, fetch: 142, ioread: 0, readrows: 99000, rows: 99000)
SUBQUERY (uncorrelated)
SELECT (time: 108, fetch: 103639, fetch_time: 13, ioread: 0)
SCAN (table: dba.t1), (heap time: 70, fetch: 100384, ioread: 0, readrows: 100000, rows: 99000)
SUBQUERY (correlated)
SELECT (time: 4, fetch: 2970, fetch_time: 0, ioread: 0)
SCAN (index: dba.t1.pk_t1), (btree time: 2, fetch: 1980, ioread: 0, readkeys: 990, filteredkeys: 0, rows: 990, covered: true)
SUBQUERY_CACHE (hit: 98010, miss: 990, size: 269384, status: enabled)
9 changes: 9 additions & 0 deletions ko/admin/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ CUBRID는 데이터베이스 서버, 브로커, CUBRID 매니저로 구성된다
| | temp_file_memory_size_in_pages | 서버 | | int | 4 | |
| +-------------------------------------+-------------------------+---------+----------+--------------------------------+-----------------+
| | thread_stacksize | 서버 | | byte | 1,048,576 | |
| +-------------------------------------+-------------------------+---------+----------+--------------------------------+-----------------+
| | max_subquery_cache_size | 서버 | | byte | 2,097,152(2M) | |
+-------------------------------+-------------------------------------+-------------------------+---------+----------+--------------------------------+-----------------+
| :ref:`disk-parameters` | db_volume_size | 서버 | | byte | 512M | |
| +-------------------------------------+-------------------------+---------+----------+--------------------------------+-----------------+
Expand Down Expand Up @@ -682,6 +684,8 @@ CUBRID 설치 시 생성되는 기본 데이터베이스 환경 설정 파일(**
+--------------------------------+--------+---------------------------+---------------------------+---------------------------+
| thread_stacksize | byte | 1,048,576 | 65,536 | |
+--------------------------------+--------+---------------------------+---------------------------+---------------------------+
| max_subquery_cache_size | byte | 2,097,152(2M) | 0 | 16,777,216(16M) |
+--------------------------------+--------+---------------------------+---------------------------+---------------------------+

**data_buffer_size**

Expand Down Expand Up @@ -739,6 +743,11 @@ CUBRID 설치 시 생성되는 기본 데이터베이스 환경 설정 파일(**

**thread_stacksize**\ 는 스레드의 스택 크기를 설정하기 위한 파라미터로 기본값은 **1048576** 바이트이다. **thread_stacksize** 파라미터의 설정값은 운영체제가 허용하는 스택 크기를 초과할 수 없다.

**max_subquery_cache_size**

**max_subquery_cache_size**\ 는 서브 쿼리 캐시의 크기를 설정하기 위한 파라미터로 기본값은 **2097152** 바이트이다.
저장공간이 부족한 경우 더 이상 서브 쿼리 캐시를 사용할 수 없다.

.. _disk-parameters:

디스크 관련 파라미터
Expand Down
3 changes: 1 addition & 2 deletions ko/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@
html_static_path = ['_static']

def setup(app):
#app.add_css_file('style.css')
app.add_stylesheet('style.css')
app.add_css_file('style.css')
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
html_last_updated_fmt = '%b %d, %Y'
Expand Down
79 changes: 79 additions & 0 deletions ko/sql/tuning.rst
xmilex-git marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@
NO_COVERING_IDX |
NO_MULTI_RANGE_OPT |
NO_SORT_LIMIT |
NO_SUBQUERY_CACHE |
NO_PUSH_PRED |
NO_MERGE |
NO_ELIMINATE_JOIN |
Expand Down Expand Up @@ -726,6 +727,7 @@
* **NO_COVERING_IDX**: 커버링 인덱스 기능을 사용하지 않도록 하는 힌트이다. 자세한 내용은 :ref:`covering-index`\를 참고한다.
* **NO_MULTI_RANGE_OPT**: 다중 키 범위 최적화 기능을 사용하지 않도록 하는 힌트이다. 자세한 내용은 :ref:`multi-key-range-opt`\를 참고한다.
* **NO_SORT_LIMIT**: SORT-LIMIT 최적화를 사용하지 않기 위한 힌트이다. 자세한 내용은 :ref:`sort-limit-optimization`\를 참고한다.
* **NO_SUBQUERY_CACHE**: SUBQUERY_CACHE 최적화를 사용하지 않기 위한 힌트이다.
xmilex-git marked this conversation as resolved.
Show resolved Hide resolved
* **NO_PUSH_PRED**: PREDICATE-PUSH 최적화를 사용하지 않기 위한 힌트이다.
* **NO_MERGE**: VIEW-MERGE 최적화를 사용하지 않기 위한 힌트이다.
* **NO_ELIMINATE_JOIN**: 조인 제거 최적화를 사용하지 않기 위한 힌트이다. 자세한 내용은 :ref:`join-elimination-optimization`\를 참고한다.
Expand Down Expand Up @@ -783,7 +785,7 @@
FROM a INNER JOIN b ON a.col=b.col
INNER JOIN c ON b.col=c.col INNER JOIN d ON c.col=d.col;

위와 같은 질의를 수행한다면 **LEADING** 힌트는 무시되며, **ORDERED** 힌트에 따라서 **FROM**절의 순서인, 테이블 a, b, c, d의 순서로 조인된다.

Check warning on line 788 in ko/sql/tuning.rst

View workflow job for this annotation

GitHub Actions / build_docs (ko)

Inline strong start-string without end-string.

.. code-block:: sql

Expand Down Expand Up @@ -4191,3 +4193,80 @@
}

캐시 된 질의는 결과 화면 중간에 **query_string** 으로 표시되며 각 **n_entries** 및 **n_pages** 는 캐시된 질의 수와 캐시 된 결과의 페이지 수를 나타낸다. **n_entries** 는 파라미터 **max_query_cache_entries** 의 값으로 제한되고 **n_pages** 는 **query_cache_size_in_pages** 의 값으로 제한된다. **n_entries** 가 초과되거나 **n_pages** 가 초과되면 캐시 항목 중 일부가 삭제될 후보로 선택되어 삭제되고, 삭제되는 캐시는 **max_query_cache_entries** 값과 **query_cache_size_in_pages** 값의 약 20% 이다.

.. _subquery-cache:
xmilex-git marked this conversation as resolved.
Show resolved Hide resolved

서브 쿼리 캐시 (correlated)
------------------------------------

서브 쿼리 캐시 최적화는 상관 부질의(correlated subquery)를 포함한 질의의 성능을 향상시키는데 사용할 수 있으며, 부질의의 결과는 부질의마다 독립적인 공간에 캐시된다.
xmilex-git marked this conversation as resolved.
Show resolved Hide resolved
xmilex-git marked this conversation as resolved.
Show resolved Hide resolved
서브 쿼리 캐시 최적화를 하지 않으려면 **NO_SUBQUERY_CACHE** 힌트를 해당 부질의에 사용해야 한다.
xmilex-git marked this conversation as resolved.
Show resolved Hide resolved

서브 쿼리 캐시는 다음과 같은 상황에 동작하지 않는다:
xmilex-git marked this conversation as resolved.
Show resolved Hide resolved

* 상관 부질의가 상관 부질의를 포함한 경우.
xmilex-git marked this conversation as resolved.
Show resolved Hide resolved
* 부질의가 SELECT 절에 있지 않은 경우.
* 부질의에 클래스 관련 큐브리드 확장 API를 사용하는 경우.
xmilex-git marked this conversation as resolved.
Show resolved Hide resolved
* 부질의가 **NO_SUBQUERY_CACHE** 힌트를 포함한 경우.
* 새로운 결과를 저장할 때 설정한 서브 쿼리 캐시 크기(기본값: 2MB)를 초과하는 경우.
* random (), sys_guid ()와 같이 실행 시마다 결과가 바뀌는 함수가 포함된 경우.
xmilex-git marked this conversation as resolved.
Show resolved Hide resolved

상관 부질의가 SELECT 절에 있는 경우 서브 쿼리 캐시를 사용한다.
매번 재실행되는 상관 부질의 중, 상관 부질의에서 참조한 본 질의의 컬럼 값이 같은 경우 캐시된 결과를 사용하여 재실행을 방지한다.
캐시된 질의를 찾을 수 없는 경우 부질의가 처리된 다음 결과와 함께 컬럼 값과 질의 결과를 캐시한다.
xmilex-git marked this conversation as resolved.
Show resolved Hide resolved
같은 컬럼 값이 캐시에서 발견되면 캐시된 영역에서 결과를 가져온다.
CSQL에서는 아래 예제와 같이 COUNT 함수를 사용하여 질의를 반복적으로 실행할 때 개선된 성능을 쉽게 측정할 수 있다.
첫 번째 부질의에 대한 결과는 캐시가 되어 있지 않아서 느리지만, 두 번째 부질의의 결과는 캐시된 영역에서 가져오므로 응답 시간이 이전 질의보다 훨씬 빠르다. ::
xmilex-git marked this conversation as resolved.
Show resolved Hide resolved
xmilex-git marked this conversation as resolved.
Show resolved Hide resolved

csql> SELECT count(*) from (
SELECT /*+ recompile no_merge */
(SELECT /*+ NO_SUBQUERY_CACHE */ t1_pk FROM t1 b WHERE b.t1_pk = a.c3)
FROM
t1 a
WHERE a.c2 >= 1);
xmilex-git marked this conversation as resolved.
Show resolved Hide resolved
=== <Result of SELECT Command in Line 2> ===

count(*)
======================
99000

1 row selected. (0.626199 sec) Committed. (0.000011 sec)

1 command(s) successfully processed.

Trace Statistics:
SELECT (time: 621, fetch: 397811, fetch_time: 56, ioread: 0)
SCAN (temp time: 7, fetch: 142, ioread: 0, readrows: 99000, rows: 99000)
SUBQUERY (uncorrelated)
SELECT (time: 607, fetch: 397669, fetch_time: 56, ioread: 0)
SCAN (table: dba.t1), (heap time: 98, fetch: 100384, ioread: 0, readrows: 100000, rows: 99000)
SUBQUERY (correlated)
SELECT (time: 460, fetch: 297000, fetch_time: 0, ioread: 0)
SCAN (index: dba.t1.pk_t1), (btree time: 243, fetch: 198000, ioread: 0, readkeys: 99000, filteredkeys: 0, rows: 99000, covered: true)

csql> SELECT count(*) from (
SELECT /*+ recompile no_merge */
(SELECT t1_pk FROM t1 b WHERE b.t1_pk = a.c3)
FROM
t1 a
WHERE a.c2 >= 1);
xmilex-git marked this conversation as resolved.
Show resolved Hide resolved
=== <Result of SELECT Command in Line 6> ===

count(*)
======================
99000

1 row selected. (0.128251 sec) Committed. (0.000010 sec)

1 command(s) successfully processed.

Trace Statistics:
SELECT (time: 122, fetch: 103781, fetch_time: 13, ioread: 0)
SCAN (temp time: 7, fetch: 142, ioread: 0, readrows: 99000, rows: 99000)
SUBQUERY (uncorrelated)
SELECT (time: 108, fetch: 103639, fetch_time: 13, ioread: 0)
SCAN (table: dba.t1), (heap time: 70, fetch: 100384, ioread: 0, readrows: 100000, rows: 99000)
SUBQUERY (correlated)
SELECT (time: 4, fetch: 2970, fetch_time: 0, ioread: 0)
SCAN (index: dba.t1.pk_t1), (btree time: 2, fetch: 1980, ioread: 0, readkeys: 990, filteredkeys: 0, rows: 990, covered: true)
SUBQUERY_CACHE (hit: 98010, miss: 990, size: 269384, status: enabled)
xmilex-git marked this conversation as resolved.
Show resolved Hide resolved
Loading