-
Notifications
You must be signed in to change notification settings - Fork 698
Docs: describe diagnostics collection #19007
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
Open
shnikd
wants to merge
22
commits into
ydb-platform:main
Choose a base branch
from
shnikd:YDBDOCS-1136-collect-diagnostics
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+295
−0
Open
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
a09f70b
Initial commit
shnikd 1ab0466
Fixes
shnikd f8302eb
Fixes
shnikd 64ca1e2
Fixes
shnikd 94a9af6
Fixes
shnikd ad16744
Fixes
shnikd 80d7567
Fixes
shnikd 6311e35
Fixes
shnikd 11ca1e5
Fixes
shnikd a44eafa
Update ydb/docs/en/core/reference/ydb-cli/sql.md
shnikd 1d0bbad
Update ydb/docs/en/core/reference/ydb-cli/sql.md
shnikd 8daa7d9
Fixes
shnikd e86312e
Fixes
shnikd abb6043
Update ydb/docs/en/core/reference/ydb-cli/sql.md
shnikd 66e25b1
Update ydb/docs/en/core/reference/ydb-cli/sql.md
shnikd ff59862
Update ydb/docs/en/core/reference/ydb-cli/sql.md
shnikd 6b55eb9
Update ydb/docs/en/core/reference/ydb-cli/sql.md
shnikd d6fa1d3
Apply suggestions from code review
shnikd 7558cc2
Fixes
shnikd 437252c
Fixes
shnikd 39b7f69
Fixes
shnikd f044cf2
Fixes
shnikd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ | |
|| `--explain` | Выполнить explain-запрос, будет выведен логический план запроса. Сам запрос не будет выполнен, поэтому не затронет данные в базе. || | ||
|| `--explain-ast` | То же, что и `--explain`, но вдобавок к логическому плану выводит [AST (abstract syntax tree)](https://ru.wikipedia.org/wiki/Абстрактное_синтаксическое_дерево). Раздел с AST содержит представление на внутреннем языке [miniKQL](../../concepts/glossary.md#minikql). || | ||
|| `--explain-analyze` | Выполнить запрос в режиме `EXPLAIN ANALYZE`. Показывает план выполнения запроса. Возвращаемые в рамках запроса данные игнорируются.<br/>**Важное замечание: Запрос фактически выполняется, поэтому может внести изменения в базу**. || | ||
|| `--diagnostics-file` | Путь для сохранения файла с диагностикой. || | ||
|| `--format` | Формат вывода.<br/>Возможные значения: | ||
|
||
{% include notitle [format](./_includes/result_format_common.md) %} | ||
|
@@ -38,6 +39,27 @@ | |
|| | ||
|# | ||
|
||
### Сбор диагностики | ||
shnikd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Опция `--diagnostics-file <path_to_diagnostics>` позволяет сохранять расширенную информацию о выполнении SQL-запросов в отдельный JSON-файл. | ||
|
||
Диагностика формируется при сборе статистики (`--stats full` или `--stats profile`), а также при выполнении `EXPLAIN`-запросов. Для каждого запроса будет создан файл `<path_to_diagnostics>.json` со следующими полями: | ||
shnikd marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Для каждого запроса - откуда их несколько возникает? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Для каждого запроса который ты выполняешь через ydb sql |
||
|
||
- **`created_at`** — время начала запроса (timestamp) | ||
- **`query_cluster`** — название кластера или провайдера | ||
- **`query_database`** — путь к базе данных | ||
- **`query_id`** — уникальный идентификатор запроса | ||
- **`query_plan`** — план выполнения запроса | ||
- **`query_syntax`** — используемый синтаксис запроса | ||
- **`query_text`** — текст SQL-запроса | ||
|
||
**Внимание!** Это поле может содержать чувствительные или личные данные пользователя, включая значения параметров в запросе. | ||
- **`query_type`** — тип запроса | ||
- **`table_metadata`** — схемы, индексы и статистика по таблицам, участвующим в запросе (формат JSON) | ||
|
||
shnikd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
> **Важно:** | ||
> Файл диагностики может содержать конфиденциальные данные, особенно в поле `query_text`. Перед передачей такого файла сторонним лицам (например, в техническую поддержку) рекомендуется вручную просмотреть и отредактировать содержимое файла, чтобы удалить или заменить чувствительную информацию. | ||
|
||
### Работа с параметризованными запросами {#parameterized-query} | ||
|
||
Подробное описание работы с параметрами с примерами смотрите в статье [{#T}](parameterized-query-execution.md). | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.