Hello.

AFAIK, this feature was implemented for Apache Ignite that uses query 
planner of H2 internally.

However, you can use it in H2 too.

Note that this setting actually affects only the current session and does 
not require any privileges (online documentation is not correct), so you 
can enable or disable it in different connections separately using SET 
LAZY_QUERY_EXECUTION 1|0. Connection pools don't reset value of this 
setting to default, so use them with caution and always enable or disable 
it explicitly when connection pool is used and you want to use it only in 
some connections.

Also note that for some (many) queries lazy query execution is not possible 
and this setting does not affect them. For example, lazy execution is not 
possible if result needs to be sorted and there is no compatible index.

- how does this affect query speed? Any scenario's where this option may be 
> much quicker/slower than the default mode?

This setting is useful when you have a very large query, but need only some 
first rows, but don't know how many rows you need before execution of the 
query, because required number of rows depends somehow on values in the 
first rows. In such exotic use cases it can improve speed and reduce disk 
I/O significantly, because you can break execution earlier. However, it 
depends on possibility to produce rows one by one, it is not possible in 
some queries. It may be useful in some large queries to avoid buffering of 
result set on the disk.

Typically lazy queries are not expected to be faster.

- how does this affect memory use?

It reduces memory and / or disk space usage for queries with large results. 
But if your application reads result sets very slowly lazy execution may 
have negative impact on overall performance.

- does this have any positive/negative influence on concurrency?

You need to measure it by yourself with your application.

- are there restrictions to using this option? For example: can I have 
> hundreds of connections at the same time using this option?

There are no restrictions. If some query is not compatible with lazy 
execution it will be executed in normal way automatically.

- can this be considered stable and fit for production? The release notes 
> say it is no longer "experimental" but can I interpret that as it being as 
> stable as the default mode?

It should produce correct results. Some queries were very slow with this 
setting enabled and that issue was resolved. However, I don't think that 
many people use it in H2.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to