You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ydb/docs/en/core/dev/example-app/python/index.md
+55-1Lines changed: 55 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -488,4 +488,58 @@ A code snippet demonstrating the explicit use of `transaction().begin()` and `tx
488
488
{% endlist %}
489
489
490
490
However, it is worth remembering that a transaction can be opened implicitly at the first request. It could be commited automatically with the explicit indication of the `commit_tx=True` flag.
491
-
Implicit transaction management is preferable because it requires fewer server calls.
491
+
Implicit transaction management is preferable because it requires fewer server calls. An example of implicit control will be demonstrated in the next block.
492
+
493
+
## Huge Selects {#huge-selects}
494
+
495
+
To perform `SELECT` operations with an unlimited number of found rows, you must also use the `transaction().execute(query)` method. As mentioned above, the result of the work is an iterator - unlike `pool.execute_with_retries(query)`, it allows you to go through the selection without first loading it into memory.
496
+
497
+
Example of a `SELECT` with unlimited data and implicit transaction control:
Однако стоит помнить, что транзакция может быть открыта неявно при первом запросе. Завершиться же она может автоматически с явным указанием флага `commit_tx=True`.
492
-
Неявное управление транзакцией предпочтительно, так как требует меньше обращений к серверу.
492
+
Неявное управление транзакцией предпочтительно, так как требует меньше обращений к серверу. Пример неявного управления будет продемонстрирован в следующем блоке.
493
+
494
+
## Чтение неограниченной выборки {#huge-selects}
495
+
496
+
Для выполнения операций `SELECT` с неограниченным количеством найденных строк нужно также использовать метод `transaction().execute(query)`. Как было сказано выше, результатом работы является итератор - он, в отличие от `pool.execute_with_retries(query)`, позволяет пройтись по выборке не загружая ее предварительно в память.
497
+
498
+
Пример `SELECT` с неограниченным количеством данных и неявным контролем транзакции:
0 commit comments