crossdb-org / crossdb

Ultra High-performance Lightweight Embedded and Server OLTP RDBMS✨
https://crossdb.org
Mozilla Public License 2.0
163 stars 8 forks source link

"fsync / sync" time? #26

Closed sprappcom closed 13 hours ago

sprappcom commented 3 days ago

i havent check the code in detail. i'm assuming it's fsync from time to time since it is using mmap right? is it possible to set this fsync delay or something?

can you pls explain how often is the mmap data written to disk?

dbg_option only vaild in debug purpose? what does it mean?

This command can only be used for embedded database. dbg_option is only valid for current session and only for debug purpose.
OPEN DATABASE {db_name | '[path/]db_name'} [dbg_option] ...

dbg_option:
    FLUSHMODE = {ASYNC | SYNC | NOSYNC}
  | LOCKMODE = {THREAD | PROCESS | NOLOCK}
jcwangxp commented 13 hours ago

on-disk DB will provide more options to config sync period and sync commit count.

The dbg_option is to use xdb-cli to open DB, and you can set different mode to open the DB. For example, if the DB lockmode is process, and one table is write-locked by a running process, then if you use xdb-cli to open the DB, then you can't select the data which will be blocked. But if you use xdb-cli to open the db with lockmode=thread, then you can view the table, but you MUST not change table. You can think this option is to overwrite the DB's configuration in current xdb-cli session.