<HTML><BODY><div><br><br>Hi!<blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">Понедельник, 28 декабря 2020, 15:13 +03:00 от Nikita Pettik <korablev@tarantool.org>:<br> <div id=""><div class="js-helper js-readmsg-msg"><div><div id="style_16091575870734589272_BODY">On 28 Dec 11:54, Leonid Vasiliev wrote:<br>> Hi!<br>><br>> On 24.12.2020 19:57, Nikita Pettik wrote:<br>> > On 11 Dec 18:29, Leonid Vasiliev wrote:<br>> ><br>> > IMHO before pushing performance aimed patches, we should carefully<br>> > review them. Could you run some SQL benchmarks to verify there's<br>> > no degradation on any case?<br>><br>> Can you tell me where we have benchmarks for SQL and how to run them?<br><br>We have tpc-h/tpc-c bench at least as I know:<br><a href="https://github.com/tarantool/tpcc" target="_blank">https://github.com/tarantool/tpcc</a><br><a href="https://github.com/tarantool/tpch" target="_blank">https://github.com/tarantool/tpch</a><br><br>Please contact QA team to get instructions how to lauch them.<br> </div></div></div></div></blockquote></div><div> </div><div>As I understood after conversation with Timur, Oleg can help me.<br>So, I'll add him to the mailing list.<br>Oleg, can you help me with the benchmarks?</div><div> </div><div><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;"><div><div class="js-helper js-readmsg-msg"><div><div>> > Also, does this change affect non-SQL<br>> > users? I mean does SQL tmp cache is lazy initialized or it allocates<br>> > all 20mb right on start? For sure, 18mb is not a lot memory in 2020,<br>> > but still it may turn out to be surprise for some users..<br>><br>> The memory allocation is done on per-request basis:<br>> "The default page cache implemention does not allocate the full amount<br>> of cache memory all at once. Cache memory is allocated in smaller chunks<br>> on an as-needed basis."<br><br>Ok, fine, at least it won't affect users which don't use SQL sub-system.<br>So then we should only make sure that cache increase only improves<br>SQL performance on standard benches.<br><br>> > > On 11.12.2020 15:09, Nikita Pettik wrote:<br>> > > > On 11 Dec 01:37, Leonid Vasiliev wrote:<br>> > > > > Increase the maximum number of in-memory pages to use<br>> > > > > for temporary tables.<br>> > > > > (<a href="https://www.sqlite.org/compile.html#default_cache_size" target="_blank">https://www.sqlite.org/compile.html#default_cache_size</a>)<br>> > > > ><br>> > > > > Part of #5609<br>> > > > > ---<br>> > > > ><br>> > > > > Hi SQL team. It is a simplest part of #5609.<br>> > > > > This patch increases the default SQL cache size by 10 times to 20 MB.<br>> > > > > A similar experiment shows a 10% performance increase for some datasets.<br>> > > > > (<a href="https://github.com/tarantool/tarantool/issues/5593#issuecomment-740044007" target="_blank">https://github.com/tarantool/tarantool/issues/5593#issuecomment-740044007</a>).<br>> > > > > Mons approved these changes. I haven't done any research to determine the<br>> > > > > optimal value. So feel free to throw this patch away.<br>> > > ><br>> > > > Hi, why not inroduce separate handler for user to change this setting?<br>> > > > Since SQLite is embedded database, almost all settings are set at<br>> > > > compile time. In constrast, we can move it to the box.<br>> > > ><br>> > ><br>> > > If I understood you correctly, the settings should be implemented when<br>> > > working on # 5609 (this path doesn't close the task). This is the<br>> > > simplest improvement to update the default.<br>> > ><br>> > > > > <a href="https://github.com/tarantool/tarantool/issues/5609" target="_blank">https://github.com/tarantool/tarantool/issues/5609</a><br>> > > > > <a href="https://github.com/tarantool/tarantool/tree/lvasiliev/gh-5609-increase-default-sql-sort-cache-size" target="_blank">https://github.com/tarantool/tarantool/tree/lvasiliev/gh-5609-increase-default-sql-sort-cache-size</a><br>> > > > ><br>> > > > > src/box/CMakeLists.txt | 4 ++++<br>> > > > > 1 file changed, 4 insertions(+)<br>> > > > ><br>> > > > > diff --git a/src/box/CMakeLists.txt b/src/box/CMakeLists.txt<br>> > > > > index 19203f7..7372179 100644<br>> > > > > --- a/src/box/CMakeLists.txt<br>> > > > > +++ b/src/box/CMakeLists.txt<br>> > > > > @@ -218,6 +218,10 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")<br>> > > > > add_definitions(-DSQL_DEBUG=1)<br>> > > > > endif()<br>> > > > > add_definitions(-DSQL_TEST=1)<br>> > > > > +# Set the maximum number of in-memory pages to use for temporary tables.<br>> > > > > +# 20000 * 1024 = 20480000 bytes.<br>> > > > > +# (<a href="https://www.sqlite.org/compile.html#default_cache_size" target="_blank">https://www.sqlite.org/compile.html#default_cache_size</a>)<br>> > > > > +add_definitions(-DSQL_DEFAULT_CACHE_SIZE=-20000)<br>> > > > > set(EXT_SRC_DIR ${CMAKE_SOURCE_DIR}/extra)<br>> > > > > set(EXT_BIN_DIR ${CMAKE_BINARY_DIR}/extra)<br>> > > > > --<br>> > > > > 2.7.4<br>> > > > ></div></div></div></div></blockquote> <div> </div><div data-signature-widget="container"><div data-signature-widget="content"><div>--<br>Leonid Vasiliev</div></div></div><div> </div></div></BODY></HTML>