Skip to content

Conversation

@jepett0
Copy link
Contributor

@jepett0 jepett0 commented Mar 29, 2024

YDBDOCS-142

Docs in both English and Russian on:

  • CREATE VIEW
  • ALTER VIEW
  • DROP VIEW

commands and on the:

  • View concept in general, which specifies some limitations that the current implementation has.

@ydb-platform ydb-platform deleted a comment from github-actions bot Mar 29, 2024
@ydb-platform ydb-platform deleted a comment from github-actions bot Mar 29, 2024
@ydb-platform ydb-platform deleted a comment from github-actions bot Mar 29, 2024
@ydb-platform ydb-platform deleted a comment from github-actions bot Mar 29, 2024
@ydb-platform ydb-platform deleted a comment from github-actions bot Apr 2, 2024
@ydb-platform ydb-platform deleted a comment from github-actions bot Apr 2, 2024
@ydb-platform ydb-platform deleted a comment from github-actions bot Apr 2, 2024
@ydb-platform ydb-platform deleted a comment from github-actions bot Apr 2, 2024
@ydb-platform ydb-platform deleted a comment from github-actions bot Apr 2, 2024
@ydb-platform ydb-platform deleted a comment from github-actions bot Apr 2, 2024
@github-actions
Copy link

github-actions bot commented Apr 2, 2024

✅ Documentation build

Revision built successfully
Revision preview link

@jepett0 jepett0 marked this pull request as ready for review April 2, 2024 15:24
@jepett0 jepett0 requested a review from a team as a code owner April 2, 2024 15:24
@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions
Copy link

✅ Documentation build

Revision built successfully
Revision preview link

@jepett0 jepett0 requested a review from blinkov April 11, 2024 13:50
Comment on lines 54 to 58
### Problem statement

Imagine the following situation.

Alice continuously executes the following query:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Problem statement
Imagine the following situation.
Alice continuously executes the following query:
### Problem example
Let's consider the following situation. Alice repeatedly executes the following query:

Copy link
Contributor Author

@jepett0 jepett0 May 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me that "Problem example" is an uncommon phrase in English. I would change that to "Example of the problem".

I applied the rest of the suggestion without any changes.

```
compilation results will be cached on the {{ ydb-short-name }} server side, and you will not notice any difference in the performance of queries using views and direct queries.

## View redefinition lag
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## View redefinition lag
## View redefinition lag
{% note warning %}
Query plans containing view definitions are currently cached. It might lead to the usage of an old query for a short while after a given view has been re-defined. This is going to be fixed in future releases. See below for a more detailed explanation.
{% endnote %}

Copy link
Contributor Author

@jepett0 jepett0 May 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to change "query plans containing view definitions" to "execution plans of queries containing views" to emphasize the fact that there are no view definitions in the execution plans. Reads from views are rewritten to reads from underlying tables during the query execution plan preparation.

And I changed "re-defined" to just "redefined", because it seems that it is more frequent.

@@ -0,0 +1,78 @@
# Представления (VIEWs)

Представление - это способ сохранить запрос и обращаться к его результатам как к настоящей таблице. Само представление не хранит данных, кроме текста запроса. Запрос, хранящийся в представлении, выполняется при каждом чтении из него, генерируя возвращаемый результат. Любые изменения в таблицах, на которые ссылается представление, немедленно отражаются в результатах чтения из него.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а тут нет той же проблемы, как и при изменении текста запроса, что новые колонки прорастут только когда кеш скомпилированного запроса не обновится? а не «немедленно» после ALTER?

Copy link
Contributor Author

@jepett0 jepett0 May 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Думаю, что нет, не должно быть задержки обновления схемы после ALTER'а колонок таблицы при чтении из VIEW. Дело в том, что в кеше записаны версии схем таблиц, участвующих в запросе. Если хоть одна версия отличается от той, которую сам про себя знает DataShard, то запрос перекомпилируется.

{% endnote %}

## Инвалидация представления

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

досыпать warning в начало как в английской версии


Представьте себе следующую ситуацию.

Алёна постоянно выполняет следующий запрос:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а это общепринятый перевод Alice/Bob? что-то не припомню чтобы такое где-то видел

Copy link
Contributor Author

@jepett0 jepett0 May 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нет, это моя фантазия. Честно говоря, не припомню, чтобы в русских примерах использовались какие-то общепринятые имена. На Википедии пишут, что иногда используются Петя и Вася, но если уж менять (я пока что не менял), то я бы выбрал Алису и Боба

@jepett0 jepett0 requested a review from a team as a code owner May 20, 2024 12:48
@jepett0 jepett0 removed the request for review from a team May 20, 2024 12:51
@blinkov blinkov dismissed their stale review May 22, 2024 01:32

lgtm

fomichev3000
fomichev3000 previously approved these changes May 22, 2024
Copy link
Member

@fomichev3000 fomichev3000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В целом норм, я про какие-то вещи, которые резанули глаз написал. Я бы поправил


### Кэш результатов компиляции

{{ ydb-short-name }} кэширует результаты компиляции запросов на стороне сервера для большей скорости их выполнения. Для лёгких запросов вида `SELECT 1;` компиляция может длится в 100 раз дольше времени исполнения.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я бы избегал фраз вида "компиляция может длится в 100 раз дольше времени исполнения". Напишите просто "компиляция может занимать значительное время по сравнению с временем выполнения запроса"

@@ -0,0 +1,79 @@
# CREATE VIEW

`CREATE VIEW` создаёт представление.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нужна ссылка на концепции, где описано представление

DROP VIEW redefined_view;
CREATE VIEW redefined_view ...;
```
Но этот запрос не будет атомарным.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

я бы написал, что эффект от каждого стейтмента будет видим пользователю. То есть сначала вью пропадет, а потом появится. Но это все минорно...

jepett0 and others added 4 commits May 22, 2024 07:00
@ydb-platform ydb-platform deleted a comment from github-actions bot May 22, 2024
@github-actions
Copy link

✅ Documentation build

Revision built successfully
Revision preview link

@blinkov blinkov enabled auto-merge (squash) May 22, 2024 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants