You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "alex-plekhanov (via GitHub)" <gi...@apache.org> on 2026/04/03 07:10:13 UTC
Re: [PR] IGNITE-28377 Removed lazy flag of SqlFieldsQuery [ignite]
alex-plekhanov commented on code in PR #12947:
URL: https://github.com/apache/ignite/pull/12947#discussion_r3029989956
##########
modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2QueryInfo.java:
##########
Review Comment:
Agree with Sonar. Can be removed
##########
modules/indexing/src/test/java/org/apache/ignite/client/FunctionalQueryTest.java:
##########
@@ -125,14 +124,12 @@ public void testQueries() throws Exception {
* @param pageSize Page size.
* @param expSize The size of the expected results.
* @param exp Expected results.
- * @param lazy Lazy mode flag.
*/
private void checkSqlFieldsQuery(ClientCache<Integer, Person> cache, int minId, int pageSize, int expSize,
- Map<Integer, Person> exp, boolean lazy) {
Review Comment:
Codestyle: Each parameter on it's own line
##########
modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/LongRunningQueryTest.java:
##########
@@ -363,7 +332,6 @@ public void testLongRunningDeleteWithSubqueryLocal() {
@Test
public void testDistributedLazyWithExternalWait() {
local = false;
- lazy = true;
checkLazyWithExternalWait();
Review Comment:
Rename?
##########
docs/_docs/binary-client-protocol/sql-and-scan-queries.adoc:
##########
@@ -267,7 +267,6 @@ UPDATE = 2
|bool| Replicated only - Whether query contains only replicated tables or not.
|bool| Enforce join order.
|bool| Collocated - Whether your data is co-located or not.
-|bool| Lazy query execution.
Review Comment:
Not sure it can be deleted, it's a protocol description, I think it's better to make a not that this flag is not used anymore on server side.
##########
docs/_docs/SQL/sql-tuning.adoc:
##########
@@ -52,43 +52,10 @@ Avoid having too many columns in the result set of a `SELECT` query. Due to limi
== Lazy Loading
-By default, Ignite attempts to load the whole result set to memory and send it back to the query initiator (which is usually your application).
-This approach provides optimal performance for queries of small or medium result sets.
-However, if the result set is too big to fit in the available memory, it can lead to prolonged GC pauses and even `OutOfMemoryError` exceptions.
-
-To minimize memory consumption, at the cost of a moderate performance hit, you can load and process the result sets lazily by passing the `lazy` parameter to the JDBC and ODBC connection strings or use a similar method available for Java, .NET, and C++ APIs:
-
-[tabs]
---
-
-tab:Java[]
-[source,java]
-----
-SqlFieldsQuery query = new SqlFieldsQuery("SELECT * FROM Person WHERE id > 10");
-
-// Result set will be loaded lazily.
-query.setLazy(true);
-----
-tab:JDBC[]
-[source,sql]
-----
-jdbc:ignite:thin://192.168.0.15?lazy=true
-----
-tab:C#/.NET[]
-[source,csharp]
-----
-var query = new SqlFieldsQuery("SELECT * FROM Person WHERE id > 10")
-{
- // Result set will be loaded lazily.
- Lazy = true
-};
-----
-tab:C++[]
---
-
-////
-*TODO* Add tabs for ODBC and other programming languages - C# and C++
-////
+Ignite always operates in lazy loading mode. Query results are not loaded entirely into memory — data is streamed to
Review Comment:
Same as above
##########
docs/_docs/perf-and-troubleshooting/sql-tuning.adoc:
##########
@@ -78,45 +78,10 @@ with 100+ columns may perform worse than expected.
== Lazy Loading
-By default, Ignite will set Lazy Loading enabled, this will minimize memory consumption at the cost of moderate performance degradation.
-
-Otherwise, Ignite attempts to load the whole result set to memory and send it back to the query initiator (which is usually your application). This approach provides optimal performance for queries of small or medium result sets, and minimizes the duration of internal database locks, thus increasing concurrency.
-
-WARNING, if the result set is too big to fit in the available memory, it can lead to prolonged GC pauses and even `OutOfMemoryError` exceptions. This property is deprecated since Ignite 2.15.0.
-
-To change the default behavior:
-
-[tabs]
---
-
-tab:Java[]
-[source,java]
-----
-SqlFieldsQuery query = new SqlFieldsQuery("SELECT * FROM Person WHERE id > 10");
-
-// Result set will be loaded eagerly.
-query.setLazy(false);
-----
-tab:JDBC[]
-[source,sql]
-----
-jdbc:ignite:thin://192.168.0.15?lazy=false
-----
-tab:C#/.NET[]
-[source,csharp]
-----
-var query = new SqlFieldsQuery("SELECT * FROM Person WHERE id > 10")
-{
- // Result set will be loaded eagerly.
- Lazy = false
-};
-----
-tab:C++[]
---
-
-////
-*TODO* Add tabs for ODBC and other programming languages - C# and C++
-////
+Ignite always operates in lazy loading mode. Query results are not loaded entirely into memory — data is streamed to
Review Comment:
`Query results are not loaded entirely into memory` - when possible. For example, "ORDER BY" queries without index can only be sorted in memory.
##########
modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlFieldsQuery.cs:
##########
@@ -218,9 +200,7 @@ internal void Write(BinaryWriter writer)
writer.WriteBoolean(EnableDistributedJoins);
writer.WriteBoolean(EnforceJoinOrder);
-#pragma warning disable 618
- writer.WriteBoolean(Lazy); // Lazy flag.
-#pragma warning restore 618
+ writer.WriteBoolean(true); // Lazy flag.
Review Comment:
Can be removed together with line in PlatformCache
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java:
##########
@@ -1491,7 +1491,7 @@ private Query readFieldsQuery(BinaryReaderEx reader) {
boolean distrJoins = reader.readBoolean();
boolean enforceJoinOrder = reader.readBoolean();
- boolean lazy = reader.readBoolean();
+ reader.readBoolean(); // Lazy flag.
Review Comment:
For platform cache there is no need to keep this parameter, since platform version and server version are always the same. We can remove it from here and from .net and cpp part.
##########
modules/platforms/cpp/core/include/ignite/cache/query/query_sql_fields.h:
##########
@@ -378,7 +340,7 @@ namespace ignite
writer.WriteBool(distributedJoins);
writer.WriteBool(enforceJoinOrder);
- writer.WriteBool(lazy);
+ writer.WriteBool(true); // Lazy flag.
Review Comment:
Can be removed together with line in PlatformCache
##########
modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/LongRunningQueryTest.java:
##########
@@ -254,7 +224,6 @@ public void testLongDistributedLazyWithMergeTable() {
@Test
public void testLongLocalLazy() {
Review Comment:
Rename?
##########
modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/LongRunningQueryTest.java:
##########
@@ -363,7 +332,6 @@ public void testLongRunningDeleteWithSubqueryLocal() {
@Test
public void testDistributedLazyWithExternalWait() {
Review Comment:
Rename?
##########
modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/RegisteredQueryCursor.java:
##########
@@ -65,13 +65,12 @@ public class RegisteredQueryCursor<T> extends QueryCursorImpl<T> {
* @param iterExec Query executor.
* @param cancel Cancellation closure.
* @param runningQryMgr Running query manager.
- * @param lazy Lazy mode flag.
* @param qryId Registered running query id.
* @param tracing Tracing processor.
*/
public RegisteredQueryCursor(Iterable<T> iterExec, GridQueryCancel cancel, RunningQueryManager runningQryMgr,
- boolean lazy, long qryId, Tracing tracing) {
- super(iterExec, cancel, true, lazy);
+ long qryId, Tracing tracing) {
Review Comment:
Codestyle: Each parameter on it's own line
##########
modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java:
##########
@@ -469,18 +449,18 @@ public void testSqlHintsSemicolon() throws Exception {
* @param enforceJoinOrder Enforce join order.
* @param collocated Co-located.
* @param replicatedOnly Replicated only.
- * @param lazy Lazy.
* @param skipReducerOnUpdate Skip reducer on update.
* @throws Exception If failed.
*/
- private void assertHints(Connection conn, boolean distributedJoins, boolean enforceJoinOrder, boolean collocated,
- boolean replicatedOnly, boolean lazy, boolean skipReducerOnUpdate, boolean partitionAwarenessEnabled)throws Exception {
+ private void assertHints(
+ Connection conn, boolean distributedJoins, boolean enforceJoinOrder, boolean collocated,
Review Comment:
Codestyle: Each parameter on own line
##########
modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/LongRunningQueryTest.java:
##########
@@ -194,37 +190,12 @@ private static CacheConfiguration cacheConfig(String name, Class<?>... idxTypes)
.setSqlFunctionClasses(TestSQLFunctions.class);
}
- /**
- *
- */
- @Test
- public void testLongDistributed() {
- local = false;
- lazy = false;
-
- checkLongRunning();
- checkFastQueries();
- }
-
- /**
- *
- */
- @Test
- public void testLongLocal() {
- local = true;
- lazy = false;
-
- checkLongRunning();
- checkFastQueries();
- }
-
/**
*
*/
@Test
public void testLongDistributedLazy() {
Review Comment:
Rename?
##########
modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/oom/AbstractQueryOOMTest.java:
##########
@@ -272,34 +272,15 @@ public void testHeavySortByNotIndexNotLazy() throws Exception {
*/
@Test
public void testHeavyGroupByPkLazy() throws Exception {
Review Comment:
Remove `Lazy` from method name?
##########
modules/platforms/cpp/odbc/src/config/configuration.cpp:
##########
@@ -513,4 +495,3 @@ namespace ignite
}
}
}
-
Review Comment:
Is it correct to remove last empty line for cpp files here and some files below?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org